diff --git a/load_vars.rb b/load_vars.rb index bebe4d8..b39df27 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 = 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)) }