summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parameter.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-15 07:20:36 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-15 07:20:36 +0000
commit20b65e7845d55cac408fa0d9eddb5209a996076a (patch)
tree676cfe1891e9c9b0b015393a732b41a0e6af11ea /lib/puppet/parameter.rb
parent6cfee76f94824157a28354c9d6838716cb2c5d47 (diff)
downloadpuppet-20b65e7845d55cac408fa0d9eddb5209a996076a.tar.gz
puppet-20b65e7845d55cac408fa0d9eddb5209a996076a.tar.xz
puppet-20b65e7845d55cac408fa0d9eddb5209a996076a.zip
Some important bug fixes in the parsedtypes types; this all started from the submitted bug today, but I added :absent support to most params.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@910 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parameter.rb')
-rw-r--r--lib/puppet/parameter.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/puppet/parameter.rb b/lib/puppet/parameter.rb
index 82fa1bb0f..a3a935b00 100644
--- a/lib/puppet/parameter.rb
+++ b/lib/puppet/parameter.rb
@@ -290,7 +290,17 @@ module Puppet
# it possible to call for states, too.
def value
if self.is_a?(Puppet::State)
- return self.should
+ # 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.is
+ end
else
if defined? @value
return @value