summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Bode <dan@puppetlabs.com>2012-08-13 18:52:00 -0700
committerDan Bode <dan@puppetlabs.com>2012-08-13 18:52:00 -0700
commitfe85f467c8f8e65c9fd09acff17ac4adb80f12b8 (patch)
treea7b91740aaf5563b8ee06e00dcdc01df060a2a3c /lib
parentba789deac588dea83a129544f8aa00813db30bf0 (diff)
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')
-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|