1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fixes an issue with dict_merge in network utils (#41107)

This change address a problem where the dict_merge function would fail
due to the value being a nested dict.  This will now recursively pass
the value back through the dict_merge function.
This commit is contained in:
Peter Sprygada 2018-11-30 07:22:33 -05:00 committed by Ganesh Nalawade
parent c1a30c743e
commit 2a4be2748f

View file

@ -301,7 +301,10 @@ def dict_merge(base, other):
if key in other:
item = other.get(key)
if item is not None:
combined[key] = dict_merge(value, other[key])
if isinstance(other[key], dict):
combined[key] = dict_merge(value, other[key])
else:
combined[key] = other[key]
else:
combined[key] = item
else: