diff options
author | Luke Kanies <luke@puppetlabs.com> | 2010-04-12 14:10:17 -0700 |
---|---|---|
committer | Luke Kanies <luke@puppetlabs.com> | 2010-04-12 14:10:17 -0700 |
commit | 13d141acce03b50f1bfdee2b2a2cba87bcb3da70 (patch) | |
tree | b058c30ccbdfb346320524e2696c67d62b3b4664 /lib | |
parent | 66858ef73a538fd8849949b485352c9752bdbe02 (diff) | |
download | puppet-13d141acce03b50f1bfdee2b2a2cba87bcb3da70.tar.gz puppet-13d141acce03b50f1bfdee2b2a2cba87bcb3da70.tar.xz puppet-13d141acce03b50f1bfdee2b2a2cba87bcb3da70.zip |
Fixing Property#change_to_s in rare case failures
If we were removing a field, which really only 'cron'
does, then we got an exception.
This is fixed, and now tested.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/property.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb index 4b58abd1f..5e616c396 100644 --- a/lib/puppet/property.rb +++ b/lib/puppet/property.rb @@ -122,14 +122,14 @@ class Puppet::Property < Puppet::Parameter end # How should a property change be printed as a string? - def change_to_s(currentvalue, newvalue) + def change_to_s(current_value, newvalue) begin - if currentvalue == :absent + if current_value == :absent return "defined '#{name}' as '#{should_to_s(newvalue)}'" elsif newvalue == :absent or newvalue == [:absent] return "undefined '#{name}' from '#{is_to_s(current_value)}'" else - return "#{name} changed '#{is_to_s(currentvalue)}' to '#{should_to_s(newvalue)}'" + return "#{name} changed '#{is_to_s(current_value)}' to '#{should_to_s(newvalue)}'" end rescue Puppet::Error, Puppet::DevError raise |