diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/puppet/type/pfile/mode.rb | 1 | ||||
-rw-r--r-- | lib/puppet/util/config.rb | 13 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/puppet/type/pfile/mode.rb b/lib/puppet/type/pfile/mode.rb index 0a796239e..96e29aabb 100755 --- a/lib/puppet/type/pfile/mode.rb +++ b/lib/puppet/type/pfile/mode.rb @@ -43,6 +43,7 @@ module Puppet raise Puppet::Error, "File modes can only be numbers, not %s" % value.inspect end + # Make sure our number looks like octal. unless value =~ /^0/ value = "0" + value end diff --git a/lib/puppet/util/config.rb b/lib/puppet/util/config.rb index 6110d686d..afec4c943 100644 --- a/lib/puppet/util/config.rb +++ b/lib/puppet/util/config.rb @@ -281,7 +281,11 @@ class Puppet::Util::Config when /^\s*$/: next # Skip blanks when /^\s*(\w+)\s*=\s*(.+)$/: # settings var = $1.intern - value = mungearg($2) + if var == :mode + value = $2 + else + value = mungearg($2) + end # Only warn if we don't know what this config var is. This # prevents exceptions later on. @@ -304,7 +308,6 @@ class Puppet::Util::Config if var == :group and section == Puppet[:name] and @config.include?(:group) @config[:group].value = value end - next end # Don't override set parameters, since the file is parsed @@ -905,9 +908,9 @@ Generated on #{Time.now}. end [:mode].each { |var| if value = self.send(var) - # Convert it to a string, and the object will correctly - # convert it to octal. - obj[var] = value.to_s + # Don't both converting the mode, since the file type + # can handle it any old way. + obj[var] = value end } |