Project

General

Profile

« Previous | Next » 

Revision 597ab3ab

Added by Dominic Cleal about 10 years ago

fixes #4686 - don't rely on Puppet[:config] to store config file location

View differences:

lib/proxy/puppet/initializer.rb
Puppet.settings.send(:clear_everything_for_tests)
end
if SETTINGS.puppet_conf
Puppet[:config] = SETTINGS.puppet_conf
raise("Cannot read #{Puppet[:config]}") unless File.exist?(Puppet[:config])
elsif Puppet::PUPPETVERSION.to_i >= 3
Puppet[:config] = "/etc/puppet/puppet.conf"
end
logger.info "Initializing from Puppet config file: #{Puppet[:config]}"
Puppet[:config] = config
raise("Cannot read #{config}") unless File.exist?(config)
logger.info "Initializing from Puppet config file: #{config}"
if Puppet::PUPPETVERSION.to_i >= 3
# Initializing Puppet directly and not via the Faces API, so indicate
# the run mode to parse [master]. Don't use --run_mode=master or
# bug #17492 is hit and Puppet can't parse it.
Puppet.settings.initialize_global_settings(['--config', Puppet[:config], '--run_mode', 'master'])
Puppet.settings.initialize_global_settings(['--config', config, '--run_mode', 'master'])
Puppet.settings.initialize_app_defaults(Puppet::Settings.app_defaults_for_run_mode(Puppet::Util::RunMode['master']))
else
Puppet.parse_config
......
# Don't follow imports, the proxy scans for .pp files itself
Puppet[:ignoreimport] = true
end
def config
SETTINGS.puppet_conf || File.join(SETTINGS.puppetdir || '/etc/puppet', 'puppet.conf')
end
end
end

Also available in: Unified diff