summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-08 07:09:42 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-08 07:09:42 +0000
commitb6df3369bc8a1dadfab2c7baa6d4572785c075fb (patch)
tree78c91084dd33aa0cda93a9ea459c6881c4e1f7b7 /lib
parent0925fb0cd9b7d370a57247b00f402d33f6f0d78b (diff)
downloadpuppet-b6df3369bc8a1dadfab2c7baa6d4572785c075fb.tar.gz
puppet-b6df3369bc8a1dadfab2c7baa6d4572785c075fb.tar.xz
puppet-b6df3369bc8a1dadfab2c7baa6d4572785c075fb.zip
Looks like [2265] was not a complete solution -- it resulted in failures when the config set modes via integers. Everything is working now, and tested more completely.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2268 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/type/pfile/mode.rb1
-rw-r--r--lib/puppet/util/config.rb13
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
}