From 19fd344a0fdb22ef6b3c6e80bc8fd4983e56d7cb Mon Sep 17 00:00:00 2001 From: Krzysztof Wilczynski Date: Thu, 3 Mar 2011 13:14:56 +0100 Subject: Fix. The data structure should only be populated and/or set to be empty if and only if key is present. --- load_vars.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/load_vars.rb b/load_vars.rb index b39df27..4d0d14e 100644 --- a/load_vars.rb +++ b/load_vars.rb @@ -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)) } -- cgit v1.2.3