Revision 5b32c455
Added by Dominic Cleal over 7 years ago
files/foreman-report_v2.rb | ||
---|---|---|
end
|
||
|
||
if RbConfig::CONFIG['host_os'] =~ /freebsd|dragonfly/i
|
||
$settings_file = '/usr/local/etc/puppet/foreman.yaml'
|
||
$settings_file ||= '/usr/local/etc/puppet/foreman.yaml'
|
||
else
|
||
$settings_file = File.exist?('/etc/puppetlabs/puppet/foreman.yaml') ? '/etc/puppetlabs/puppet/foreman.yaml' : '/etc/puppet/foreman.yaml'
|
||
$settings_file ||= File.exist?('/etc/puppetlabs/puppet/foreman.yaml') ? '/etc/puppetlabs/puppet/foreman.yaml' : '/etc/puppet/foreman.yaml'
|
||
end
|
||
|
||
SETTINGS = YAML.load_file($settings_file)
|
Also available in: Unified diff
Remove YAML.load_file stubbing, preset $settings_file
Internally Puppet uses YAML.load_file to load the Hiera config (set to
/dev/null under rspec-puppet), but 4.9.0 uses Pathnames instead of
Strings causing the existing stub for "/dev/null" to fail.
Setting the value of $settings_file prior to evaluating the ENC/report
scripts is more reliable than stubbing the YAML constant.