summaryrefslogtreecommitdiff
path: root/lib/puppet/parser/functions
diff options
context:
space:
mode:
authorTomas Doran <tdoran@yelp.com>2013-11-19 18:38:12 +0000
committerAdrien Thebo <git@somethingsinistral.net>2014-01-15 11:03:33 -0800
commit735db82bef56bf939c971ab76a66647269d6ae35 (patch)
tree8ef7c123293b8bf020ad88326f6bc29d395a29fd /lib/puppet/parser/functions
parent01c9c3c97998c220c41b386e64468a1efff37127 (diff)
downloadpuppet-stdlib-735db82bef56bf939c971ab76a66647269d6ae35.tar.gz
puppet-stdlib-735db82bef56bf939c971ab76a66647269d6ae35.tar.bz2
Allow a single argument, rather than an array
Diffstat (limited to 'lib/puppet/parser/functions')
-rw-r--r--lib/puppet/parser/functions/ensure_packages.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/ensure_packages.rb b/lib/puppet/parser/functions/ensure_packages.rb
index 450ea02..371d63a 100644
--- a/lib/puppet/parser/functions/ensure_packages.rb
+++ b/lib/puppet/parser/functions/ensure_packages.rb
@@ -11,8 +11,7 @@ Takes a list of packages and only installs them if they don't already exist.
raise(Puppet::ParseError, "ensure_packages(): Wrong number of arguments " +
"given (#{arguments.size} for 1)") if arguments.size != 1
- raise(Puppet::ParseError, "ensure_packages(): Requires array " +
- "given (#{arguments[0].class})") if !arguments[0].kind_of?(Array)
+ arguments[0] = [ arguments[0] ] unless arguments[0].kind_of?(Array)
Puppet::Parser::Functions.function(:ensure_resource)
arguments[0].each { |package_name|