diff options
Diffstat (limited to 'lib/mixlib/config.rb')
-rw-r--r-- | lib/mixlib/config.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/mixlib/config.rb b/lib/mixlib/config.rb index 7e4e139..fd50254 100644 --- a/lib/mixlib/config.rb +++ b/lib/mixlib/config.rb @@ -568,7 +568,10 @@ module Mixlib # hash<Hash>:: The hash to apply to the config object def apply_nested_hash(hash) hash.each do |k, v| - if v.is_a? Hash + if v.is_a?(Hash) && internal_get(k.to_sym).is_a?(Hash) + # If it is a plain config key (not a context) and the value is a Hash, plain merge the Hashes. + internal_set(k.to_sym, internal_get(k.to_sym).merge(v)) + elsif v.is_a? Hash # If loading from hash, and we reference a context that doesn't exist # and warning/strict is off, we need to create the config context that we expected to be here. context = internal_get(k.to_sym) || config_context(k.to_sym) |