summaryrefslogtreecommitdiffstats
path: root/lib/puppet/property
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2011-01-25 14:34:28 -0800
committerPaul Berry <paul@puppetlabs.com>2011-01-25 15:12:47 -0800
commit67e1bba154accd900b9690d96cec8b050f8082e7 (patch)
tree54050ace3795a6671fa757464f2acc7809f466c3 /lib/puppet/property
parent0f9d23617e4115166d6b9e004332dcdf5eccc924 (diff)
downloadpuppet-67e1bba154accd900b9690d96cec8b050f8082e7.tar.gz
puppet-67e1bba154accd900b9690d96cec8b050f8082e7.tar.xz
puppet-67e1bba154accd900b9690d96cec8b050f8082e7.zip
(#5931) Prevent errors when calling insync? on audited properties
Created a method safe_insync? which first checks whether the property has a "should" value of nil, and if so returns true. Most insync? methods were already doing this, but a few were not, leading to bugs if a property was being audited but not set. Types should continue to override the insync? method, but callers of insync? should call safe_insync? instead. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
Diffstat (limited to 'lib/puppet/property')
-rw-r--r--lib/puppet/property/keyvalue.rb2
-rw-r--r--lib/puppet/property/list.rb2
2 files changed, 0 insertions, 4 deletions
diff --git a/lib/puppet/property/keyvalue.rb b/lib/puppet/property/keyvalue.rb
index 0181708f9..57d0ea2d9 100644
--- a/lib/puppet/property/keyvalue.rb
+++ b/lib/puppet/property/keyvalue.rb
@@ -77,8 +77,6 @@ module Puppet
end
def insync?(is)
- return true unless @should
-
return true unless is
(is == self.should)
diff --git a/lib/puppet/property/list.rb b/lib/puppet/property/list.rb
index dcee85db7..b86dc87f2 100644
--- a/lib/puppet/property/list.rb
+++ b/lib/puppet/property/list.rb
@@ -66,8 +66,6 @@ module Puppet
end
def insync?(is)
- return true unless @should
-
return true unless is
(prepare_is_for_comparison(is) == self.should)