summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-04-11 13:01:17 -0500
committerLuke Kanies <luke@madstop.com>2008-04-11 13:01:17 -0500
commitb49fd495622b15f96faf944db1e70cbe9e7fe7c4 (patch)
tree4b5c3ca9f5130b87c13a8a729cc1f332539361c5 /lib
parent4aaad26509b2dc9bd45782ec45231e6ea53a4a37 (diff)
downloadpuppet-b49fd495622b15f96faf944db1e70cbe9e7fe7c4.tar.gz
puppet-b49fd495622b15f96faf944db1e70cbe9e7fe7c4.tar.xz
puppet-b49fd495622b15f96faf944db1e70cbe9e7fe7c4.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/metatype/attributes.rb10
1 files changed, 3 insertions, 7 deletions
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