diff options
author | Luke Kanies <luke@madstop.com> | 2008-09-23 14:43:38 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-09-23 14:43:38 -0500 |
commit | 5fbdc49dfdb39351c7f2d9e535577efc177cf838 (patch) | |
tree | ae6056d72e7b4c10456269a7cfde7231727d6118 /lib | |
parent | c16a5aee245a9e34e6934debee8e66630aef0fda (diff) | |
download | puppet-5fbdc49dfdb39351c7f2d9e535577efc177cf838.tar.gz puppet-5fbdc49dfdb39351c7f2d9e535577efc177cf838.tar.xz puppet-5fbdc49dfdb39351c7f2d9e535577efc177cf838.zip |
Fixed #1595 - Internally, Property#retrieve is no longer called
when no 'should' value is available for a resource.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/parameter.rb | 24 | ||||
-rw-r--r-- | lib/puppet/property.rb | 5 |
2 files changed, 6 insertions, 23 deletions
diff --git a/lib/puppet/parameter.rb b/lib/puppet/parameter.rb index 31e009af5..ef7f1c1ad 100644 --- a/lib/puppet/parameter.rb +++ b/lib/puppet/parameter.rb @@ -413,29 +413,7 @@ class Puppet::Parameter @shadow = nil end - # This should only be called for parameters, but go ahead and make - # it possible to call for properties, too. - def value - if self.is_a?(Puppet::Property) - # We should return the 'is' value if there's not 'should' - # value. This might be bad, though, because the 'should' - # method knows whether to return an array or not and that info - # is not exposed, and the 'is' value could be a symbol. I - # can't seem to create a test in which this is a problem, but - # that doesn't mean it's not one. - if self.should - return self.should - else - return self.retrieve - end - else - if defined? @value - return @value - else - return nil - end - end - end + attr_reader :value # Store the value provided. All of the checking should possibly be # late-binding (e.g., users might not exist when the value is assigned diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb index 9e8bae7a4..913f43977 100644 --- a/lib/puppet/property.rb +++ b/lib/puppet/property.rb @@ -441,6 +441,11 @@ class Property < Puppet::Parameter return "%s(%s)" % [@resource.name,self.name] end + # Just return any should value we might have. + def value + self.should + end + # Provide a common hook for setting @should, just like params. def value=(value) self.should = value |