@@ -42,6 +42,7 @@ def initialize(options = {}, logger = nil)
4242 @enc = nil
4343 @fact_file = nil
4444 @node = options [ :node ]
45+ @facts_terminus = options . fetch ( :facts_terminus , 'yaml' )
4546
4647 create_structure
4748 install_directory_symlink ( logger , options [ :basedir ] )
@@ -54,7 +55,7 @@ def initialize(options = {}, logger = nil)
5455 unless options [ :hiera_config ] . nil?
5556 install_hiera_config ( logger , options [ :hiera_config ] , options [ :hiera_path_strip ] )
5657 end
57- @fact_file = install_fact_file ( logger , options ) unless options . fetch ( : facts_terminus, 'yaml' ) ! = 'yaml'
58+ @fact_file = install_fact_file ( logger , options ) if @ facts_terminus = = 'yaml'
5859 @enc = install_enc ( logger ) unless options [ :enc ] . nil? && options [ :pe_enc_url ] . nil?
5960 install_ssl ( logger , options ) if options [ :puppetdb_ssl_ca ] || options [ :puppetdb_ssl_client_cert ]
6061 end
@@ -98,7 +99,7 @@ def install_routes_yaml(logger)
9899 routes_hash = {
99100 'master' => {
100101 'facts' => {
101- 'terminus' => 'yaml' ,
102+ 'terminus' => @facts_terminus ,
102103 'cache' => 'yaml'
103104 } ,
104105 'catalog' => {
@@ -113,8 +114,8 @@ def install_routes_yaml(logger)
113114 # Install the fact file in temporary directory
114115 # @param options [Hash] Options
115116 def install_fact_file ( logger , options )
116- unless options [ : facts_terminus] . nil? || options [ :facts_terminus ] == 'yaml'
117- raise ArgumentError , "Called install_fact_file but :facts_terminus = #{ options [ : facts_terminus] } "
117+ unless @ facts_terminus == 'yaml'
118+ raise ArgumentError , "Called install_fact_file but :facts_terminus = #{ @ facts_terminus} "
118119 end
119120 unless options [ :node ] . is_a? ( String ) && !options [ :node ] . empty?
120121 raise ArgumentError , 'Called install_fact_file without node, or with an empty node'
0 commit comments