summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-29 01:25:17 -0700
committerLuke Kanies <luke@madstop.com>2008-08-29 01:25:17 -0700
commitb69c50ccd3a491b6c4a8d456af2fe6f9cac45eae (patch)
tree359b12891d79e21c9cace7256b27b40d73234d94
parent45f465bc98aa87e1066a9d748dbb6bfaaef61476 (diff)
downloadpuppet-b69c50ccd3a491b6c4a8d456af2fe6f9cac45eae.tar.gz
puppet-b69c50ccd3a491b6c4a8d456af2fe6f9cac45eae.tar.xz
puppet-b69c50ccd3a491b6c4a8d456af2fe6f9cac45eae.zip
Removing insanely stupid default property behaviour.
Basically, I had the [] method on resources returning the 'should' value if one was available, but if one wasn't available, it would retrieve the current value from the resource. This resulted in all kinds of completely ridiculous behaviours. Signed-off-by: Luke Kanies <luke@madstop.com>
-rw-r--r--lib/puppet/parameter.rb12
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/puppet/parameter.rb b/lib/puppet/parameter.rb
index 31e009af5..e8e962931 100644
--- a/lib/puppet/parameter.rb
+++ b/lib/puppet/parameter.rb
@@ -417,17 +417,7 @@ class Puppet::Parameter
# 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
+ self.should
else
if defined? @value
return @value