summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-12-02 12:24:00 -0800
committersersut <serdar@opscode.com>2013-12-02 13:49:47 -0800
commit98c36ab1d551990b6ff53bdfdaa495248659a129 (patch)
tree7293e3e963f6c0234ae90ef54b60683f13869eec
parent12d7ffe818efcbe7cfabde4a86fedcdf96c576df (diff)
downloadchef-98c36ab1d551990b6ff53bdfdaa495248659a129.tar.gz
Make sure the attributes with value nil are not converted to { } when they are being merged at the same precedence level.
-rw-r--r--chef/lib/chef/mixin/deep_merge.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/chef/lib/chef/mixin/deep_merge.rb b/chef/lib/chef/mixin/deep_merge.rb
index 8073352ee6..ca1d41b32d 100644
--- a/chef/lib/chef/mixin/deep_merge.rb
+++ b/chef/lib/chef/mixin/deep_merge.rb
@@ -146,7 +146,12 @@ class Chef
# is not applicable anymore because it results in
# duplicates when merging two array values with
# :horizontal_precedence = true.
- dest[src_key] = deep_merge!(src_value, { }, options.merge(:debug_indent => di + ' '))
+ if src_value.nil?
+ # Nothing to compute with an extra deep_merge!
+ dest[src_key] = src_value
+ else
+ dest[src_key] = deep_merge!(src_value, { }, options.merge(:debug_indent => di + ' '))
+ end
end
else # dest isn't a hash, so we overwrite it completely (if permitted)
if overwrite_unmergeable