File tree Expand file tree Collapse file tree 6 files changed +42
-1
lines changed
spec/octocatalog-diff/tests Expand file tree Collapse file tree 6 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,14 @@ def self.config
163
163
164
164
settings [ :storeconfigs ] = false
165
165
166
+ ##############################################################################################
167
+ # storeconfigs_backend
168
+ # Override the default `storeconfigs` backend of `puppetdb`
169
+ # valid options include `puppetdb`, `yaml`, `json`
170
+ ##############################################################################################
171
+
172
+ settings [ :storeconfigs_backend ] = 'puppetdb'
173
+
166
174
##############################################################################################
167
175
# bootstrap_script
168
176
# When you check out your Puppet repository, do you need to run a script to prepare that
Original file line number Diff line number Diff line change @@ -72,7 +72,12 @@ def setup
72
72
73
73
# storeconfigs?
74
74
if @options [ :storeconfigs ]
75
- cmdline . concat %w( --storeconfigs --storeconfigs_backend=puppetdb )
75
+ if @options [ :storeconfigs_backend ]
76
+ cmdline << '--storeconfigs'
77
+ cmdline << "--storeconfigs_backend=#{ Shellwords . escape ( @options [ :storeconfigs_backend ] ) } "
78
+ else
79
+ cmdline . concat %w( --storeconfigs --storeconfigs_backend=puppetdb )
80
+ end
76
81
else
77
82
cmdline << '--no-storeconfigs'
78
83
end
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class Cli
43
43
compare_file_text : true ,
44
44
display_datatype_changes : true ,
45
45
parallel : true ,
46
+ storeconfigs_backend : 'puppetdb' ,
46
47
suppress_absent_file_details : true ,
47
48
hiera_path : 'hieradata' ,
48
49
use_lcs : true
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ # Set storeconfigs (integration with PuppetDB for collected resources)
4
+ # @param parser [OptionParser object] The OptionParser argument
5
+ # @param options [Hash] Options hash being constructed; this is modified in this method.
6
+ OctocatalogDiff ::Cli ::Options ::Option . newoption ( :storeconfigs ) do
7
+ has_weight 220
8
+
9
+ def parse ( parser , options )
10
+ parser . on ( '--storeconfigs-backend TERMINUS' , 'Set the terminus used for storeconfigs' ) do |x |
11
+ options [ :storeconfigs_backend ] = x
12
+ end
13
+ end
14
+ end
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../options_helper'
4
+
5
+ describe OctocatalogDiff ::Cli ::Options do
6
+ describe '#opt_storeconfigs_backend' do
7
+ it 'should accept all valid arguments' do
8
+ result = run_optparse ( [ '--storeconfigs-backend' , 'puppetdb' ] )
9
+ expect ( result [ :storeconfigs_backend ] ) . to eq ( 'puppetdb' )
10
+ end
11
+ end
12
+ end
Original file line number Diff line number Diff line change 31
31
colors : true ,
32
32
debug : false ,
33
33
quiet : false ,
34
+ storeconfigs_backend : 'puppetdb' ,
34
35
format : :color_text ,
35
36
display_source_file_line : false ,
36
37
compare_file_text : true ,
You can’t perform that action at this time.
0 commit comments