Fix. Should yield empty data structure when given key cannot be found in the hash upon parsing YAML file.
This commit is contained in:
parent
688fd8c1aa
commit
c5293e630c
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ module Puppet::Parser::Functions
|
|||
raise(Puppet::ParseError,
|
||||
"Data in the file `%s' is not a hash" % file) unless data.is_a?(Hash)
|
||||
|
||||
data = data[key] if key and data[key].is_a?(Hash)
|
||||
data = (key and data[key].is_a?(Hash) ? data[key] : {})
|
||||
end
|
||||
|
||||
data.each { |param, value| setvar(param, strinterp(value)) }
|
||||
|
|
Loading…
Reference in a new issue