diff options
author | Krzysztof Wilczynski <krzysztof.wilczynski@linux.com> | 2011-03-03 09:18:12 +0000 |
---|---|---|
committer | Krzysztof Wilczynski <krzysztof.wilczynski@linux.com> | 2011-03-03 09:18:12 +0000 |
commit | c5293e630c8c764c66721cbae5fa828b4f213f8b (patch) | |
tree | 54688206749b6734834f6d788a47fd31bcb4e93e | |
parent | 688fd8c1aa17e9b834b0e376ad5f6d16ec8ab370 (diff) |
Fix. Should yield empty data structure when given key cannot be found in the hash upon parsing YAML file.
-rw-r--r-- | load_vars.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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)) } |