Issue #3366 has been updated by Luke Kanies. Status changed from Needs design decision to Code Insufficient Assigned to deleted (Luke Kanies) Priority changed from High to Normal
I'm not terribly fond of this fix. For one, it hard-codes 'tags' support into Settings, but it also just perpetuates the problem of confusing when something is a bool vs. not. You should be able to tell whether a given setting is a boolean, with something like: <pre> if @config[str].is_a?(Puppet::Util::Settings::BooleanSetting) ...treat it like a boolean... else ...don't... end </pre> That way you can get rid of the confusion that results on non-boolean settings getting boolean values, while not having to special case tags (and the next setting this happens to). And, of course, it'd be nice to see a regression test that breaks before the fix and is fixed by the fix. ---------------------------------------- Bug #3366: --tags '' causes runtime error 'undefined method `each' for true:TrueClass' http://projects.reductivelabs.com/issues/3366 Author: Mike Pountney Status: Code Insufficient Priority: Normal Assigned to: Category: tags Target version: 0.25.5 Affected version: 0.25.4 Keywords: tags Branch: Running: puppetd -v -o --tags '' --no-daemonize results in: err: Got an uncaught exception of type NoMethodError: undefined method `each' for true:TrueClass After running with --trace, this is due to the value to --tags being set incorrectly to true, which then causes an exception at puppet/util/tagging.rb:46 This is pretty serious for us, as we run with tags set in the puppetd.conf (specifically, we set tags = 'autoapply' for normal cron runs, and perform a full run manually using --tags ''). Patch to fix: --- a/lib/puppet/util/settings.rb +++ b/lib/puppet/util/settings.rb @@ -155,7 +155,9 @@ class Puppet::Util::Settings end str = str.intern - if value == "" or value.nil? + if str == :tags and value == "" + # tags arg can be empty + elsif value == "" or value.nil? value = bool end -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://reductivelabs.com/redmine/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
