summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
authorDan Bode <dan@puppetlabs.com>2012-08-13 18:52:00 -0700
committerJeff McCune <jeff@puppetlabs.com>2012-10-25 10:54:33 -0700
commit4f8b133917255451b1f28128e26b36305c23d254 (patch)
treec23e7f7bbcf72e3ea17fb333f174cbf6fd4f73fe /lib/puppet/parser/functions
parenta0cb8cdee42125c7acd64f17af603a2fa9375863 (diff)
downloadpuppet-stdlib-4f8b133917255451b1f28128e26b36305c23d254.tar.gz
puppet-stdlib-4f8b133917255451b1f28128e26b36305c23d254.tar.bz2
Handle undef for parameter argument
This commit adds better handling of the case where undef is passed as the parameter value. This works by converting '' into []
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/defined_with_params.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/defined_with_params.rb b/lib/puppet/parser/functions/defined_with_params.rb
index e09e41c..d7df306 100644
--- a/lib/puppet/parser/functions/defined_with_params.rb
+++ b/lib/puppet/parser/functions/defined_with_params.rb
@@ -20,7 +20,9 @@ ENDOFDOC
) do |vals|
reference, params = vals
raise(ArgumentError, 'Must specify a reference') unless reference
- params ||= {}
+ if (! params) || params == ''
+ params = {}
+ end
ret = false
if resource = findresource(reference.to_s)
matches = params.collect do |key, value|