Issue #3354 has been reported by David Schmitt.
----------------------------------------
Bug #3354: puppet/util/settings/file_setting.rb should internalize strings when
checking for AllowedOwners and AllowedGroups
http://projects.reductivelabs.com/issues/3354
Author: David Schmitt
Status: Unreviewed
Priority: Normal
Assigned to:
Category: settings
Target version:
Affected version: 0.25.4
Keywords:
Branch:
On Debian's 0.25.4-2~bpo50+1, the following fails:
<pre>
config = Puppet::Util::Settings.new
config.setdefaults(:reports, :basedir => {:default => @hostdir, :owner =>
:service, :mode => 0755, :desc => "munin report hack"})
</pre>
with this error:
<pre>
.....: Internal error: The :owner setting for ...: basedir must be either
'root' or 'service', not 'service'
</pre>
But this works:
<pre>
config = Puppet::Util::Settings.new
config.setdefaults(:reports, :basedir => {:default => @hostdir, :owner =>
'service', :mode => 0755, :desc => "munin report hack"})
</pre>
The only difference is <code>'service'</code> instead of <code>:service</code>.
The error occurs in puppet/util/settings/file_setting.rb:
<pre>
AllowedOwners = %w{root service}
...
unless AllowedOwners.include?(value)
</pre>
Here's the stacktrace starting from my code:
<pre>
/usr/lib/ruby/1.8/puppet/util/settings/file_setting.rb:33:in `owner='
/usr/lib/ruby/1.8/puppet/util/settings/setting.rb:44:in `send'
/usr/lib/ruby/1.8/puppet/util/settings/setting.rb:44:in `initialize'
/usr/lib/ruby/1.8/puppet/util/settings/setting.rb:38:in `each'
/usr/lib/ruby/1.8/puppet/util/settings/setting.rb:38:in `initialize'
/usr/lib/ruby/1.8/puppet/util/settings.rb:405:in `new'
/usr/lib/ruby/1.8/puppet/util/settings.rb:405:in `newsetting'
/usr/lib/ruby/1.8/puppet/util/settings.rb:538:in `setdefaults'
/usr/lib/ruby/1.8/puppet/util/settings.rb:523:in `each'
/usr/lib/ruby/1.8/puppet/util/settings.rb:523:in `setdefaults'
</pre>
I'd suggest internalizing both the Allowed* arrays and the incoming value.
--
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.