From b49fd495622b15f96faf944db1e70cbe9e7fe7c4 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Fri, 11 Apr 2008 13:01:17 -0500 Subject: Resources now return the 'should' value for properties from the [] accessor method (they previously threw an exception when this method was used with properties). This shouldn't have any affect functionally; it just makes the method equivalent to 'should' for properties, but it works for all attribute types now. --- lib/puppet/metatype/attributes.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/metatype/attributes.rb b/lib/puppet/metatype/attributes.rb index b83fcdd78..3f48f22ff 100644 --- a/lib/puppet/metatype/attributes.rb +++ b/lib/puppet/metatype/attributes.rb @@ -477,13 +477,9 @@ class Puppet::Type end if obj = @parameters[name] - # We throw a failure here, because this method is too - # ambiguous when used with properties. - if obj.is_a?(Puppet::Property) - fail "[] called on a property" - else - return obj.value - end + # Note that if this is a property, then the value is the "should" value, + # not the current value. + obj.value else return nil end -- cgit