From: Krzysztof Wilczynski Date: Thu, 3 Mar 2011 12:14:56 +0000 (+0100) Subject: Fix. The data structure should only be populated and/or set to be empty if and only... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=19fd344a0fdb22ef6b3c6e80bc8fd4983e56d7cb;p=puppet-stdlib.git Fix. The data structure should only be populated and/or set to be empty if and only if key is present. --- 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)) }