Fix. Should yield empty data structure when given key cannot be found in the hash upon parsing YAML file.

This commit is contained in:
Krzysztof Wilczynski 2011-03-03 09:18:12 +00:00
parent 688fd8c1aa
commit c5293e630c

View file

@ -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)) }