Making sure that the function hash will also work on older Rubies.
Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
This commit is contained in:
parent
b3be789b0d
commit
8733a57ffb
1 changed files with 2 additions and 0 deletions
2
hash.rb
2
hash.rb
|
@ -19,6 +19,8 @@ module Puppet::Parser::Functions
|
|||
result = {}
|
||||
|
||||
begin
|
||||
# This is to make it compatible with older version of Ruby ...
|
||||
array = array.flatten
|
||||
result = Hash[*array]
|
||||
rescue Exception
|
||||
raise(Puppet::ParseError, 'hash(): Unable to compute ' +
|
||||
|
|
Loading…
Reference in a new issue