summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>2011-03-03 13:14:56 +0100
committerKrzysztof Wilczynski <krzysztof.wilczynski@linux.com>2011-03-03 13:14:56 +0100
commit19fd344a0fdb22ef6b3c6e80bc8fd4983e56d7cb (patch)
treea839a69d6d2fba7ac841c5d941d47fe004428d14
parentc5293e630c8c764c66721cbae5fa828b4f213f8b (diff)
downloadpuppet-stdlib-19fd344a0fdb22ef6b3c6e80bc8fd4983e56d7cb.tar.gz
puppet-stdlib-19fd344a0fdb22ef6b3c6e80bc8fd4983e56d7cb.tar.bz2
Fix. The data structure should only be populated and/or set to be empty if and only if key is present.
-rw-r--r--load_vars.rb2
1 files changed, 1 insertions, 1 deletions
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)) }