mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix in dict_merge to check for Mapping
* Based on review comments for PR #49474 change the check for isinstance from `dict` to `Mapping`
This commit is contained in:
parent
77de219836
commit
329cbcf973
1 changed files with 2 additions and 1 deletions
|
@ -37,6 +37,7 @@ from itertools import chain
|
||||||
from socket import inet_aton
|
from socket import inet_aton
|
||||||
|
|
||||||
from ansible.module_utils._text import to_text
|
from ansible.module_utils._text import to_text
|
||||||
|
from ansible.module_utils.common._collections_compat import Mapping
|
||||||
from ansible.module_utils.six import iteritems, string_types
|
from ansible.module_utils.six import iteritems, string_types
|
||||||
from ansible.module_utils.basic import AnsibleFallbackNotFound
|
from ansible.module_utils.basic import AnsibleFallbackNotFound
|
||||||
|
|
||||||
|
@ -301,7 +302,7 @@ def dict_merge(base, other):
|
||||||
if key in other:
|
if key in other:
|
||||||
item = other.get(key)
|
item = other.get(key)
|
||||||
if item is not None:
|
if item is not None:
|
||||||
if isinstance(other[key], dict):
|
if isinstance(other[key], Mapping):
|
||||||
combined[key] = dict_merge(value, other[key])
|
combined[key] = dict_merge(value, other[key])
|
||||||
else:
|
else:
|
||||||
combined[key] = other[key]
|
combined[key] = other[key]
|
||||||
|
|
Loading…
Reference in a new issue