Fix. The data structure should only be populated and/or set to be empty if and only if key is present.

This commit is contained in:
Krzysztof Wilczynski 2011-03-03 13:14:56 +01:00
parent c5293e630c
commit 19fd344a0f

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 = (key and data[key].is_a?(Hash) ? data[key] : {})
data = ((data[key] and data[key].is_a?(Hash)) ? data[key] : {}) if key
end
data.each { |param, value| setvar(param, strinterp(value)) }