Puppet: System Administration Automated

Support

Ticket #484 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

PATCH: gracefully handle unknown config variables

Reported by: Jeff McCune <mccune@math.ohio-state.edu> Assigned to: luke
Priority: normal Milestone:
Component: library Version:
Severity: normal Keywords: configuration unknown parameter lockdir
Cc: Triage Stage:
Attached Patches: Complexity:

Description

Sometimes the name of a configuration variable changes or goes away between versions. This patch allows unknown configuration variables, such as:

lockdir = /tmp

This should be more robust, e.g. if an RPM installs a new version of the library but does not change the configuration file.

Here's an example of the problem this patch addresses:

Jeff,
Can you take a look at puppet on the linux boxes (specifically on zaphod)?
It seems that a new version came out and now it's broken:

# puppetd
/usr/lib/ruby/site_ruby/1.8/puppet/config.rb:42:in `[]=': Unknown
configuration parameter :lockdir (Puppet::Error)
from /usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
from /usr/lib/ruby/site_ruby/1.8/puppet/config.rb:39:in `[]='
from /usr/lib/ruby/site_ruby/1.8/puppet/config.rb:308:in `parse'
from /usr/lib/ruby/site_ruby/1.8/puppet/config.rb:278:in `each'
from /usr/lib/ruby/site_ruby/1.8/puppet/config.rb:278:in `parse'
from /usr/sbin/puppetd:268

Attachments

unknown_config_vars.patch (1.1 kB) - added by puppet on 02/08/07 01:53:45.
unknown_config_vars_02.patch (1.1 kB) - added by puppet on 02/08/07 02:07:47.
This patch should be correct. I belive the only possibilities for a config parameter at that point in the parser is that it's in metas, or @config.

Change History

02/08/07 01:53:45 changed by puppet

  • attachment unknown_config_vars.patch added.

02/08/07 01:54:47 changed by puppet

  • summary changed from gracefully handle unknown config variables to PATCH: gracefully handle unknown config variables.
  • reporter changed from puppet to Jeff McCune <mccune@math.ohio-state.edu>.

02/08/07 02:07:47 changed by puppet

  • attachment unknown_config_vars_02.patch added.

This patch should be correct. I belive the only possibilities for a config parameter at that point in the parser is that it's in metas, or @config.

02/08/07 02:10:08 changed by puppet

Luke, I'm pretty sure this is correct. The only time we should process lines in the form of foo = bar is if foo is in metas or in @config, correct?

The metas stuff threw me off in the first patch.

02/08/07 06:12:36 changed by luke

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [2181]. Note I added a unit test. Most of the changes in that commit are moving test suites.