]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
Fix. Should yield empty data structure when given key cannot be found in the hash...
authorKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Thu, 3 Mar 2011 09:18:12 +0000 (09:18 +0000)
committerKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Thu, 3 Mar 2011 09:18:12 +0000 (09:18 +0000)
load_vars.rb

index bebe4d840d186387f90c2069f3cf3a5c30fa5225..b39df27fbe22882f30adf2b75d6a256c5280965e 100644 (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 = 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)) }