theforeman/foreman — pull request #258 by domcleal (2012-11-21 19:43:15+00:00)
Title: fixes #1915 - initialise Puppet in master context

Explicitly specify the run_mode as being 'master' to ensure the config is
parsed in a puppetmaster context.

This is based on Eric's recommendation in #1915 as the run_mode has to be explicitly set to master, so as to initialise the settings we're querying. Without specifying the run_mode some basic settings don't get initialised if they're not explicitly listed in puppet.conf:

/usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:253:in `convert': Error converting value for param 'hostcert': Error converting value for param 'certdir': Error converting value for param 'ssldir': Could not find value for $vardir (Puppet::Settings::InterpolationError)