summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parameter.rb
diff options
context:
space:
mode:
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