From 3312cc1f44d1acf25ce45701a74cecd647c50858 Mon Sep 17 00:00:00 2001 From: Hailee Kenney Date: Fri, 9 Dec 2016 13:17:48 +0000 Subject: (MODULES-3829) Make ensure_packages work with < 2.0 Prior to this commit, if a hash was passed in as an argument to the ensure_packages function a method of hash duplication would be used that is not supported with versions of ruby older than 2.0. In order to ensure the method is compatible with older ruby versions, switch to a different method of duplication. Additionally add tests to prevent further regressions. --- lib/puppet/parser/functions/ensure_packages.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/puppet/parser') diff --git a/lib/puppet/parser/functions/ensure_packages.rb b/lib/puppet/parser/functions/ensure_packages.rb index 532b702..439af1e 100644 --- a/lib/puppet/parser/functions/ensure_packages.rb +++ b/lib/puppet/parser/functions/ensure_packages.rb @@ -25,7 +25,7 @@ third argument to the ensure_resource() function. end Puppet::Parser::Functions.function(:ensure_resources) - function_ensure_resources(['package', Hash(arguments[0]), defaults ]) + function_ensure_resources(['package', arguments[0].dup, defaults ]) else packages = Array(arguments[0]) -- cgit v1.2.3