From 329cbcf9739ee81c6404b81837361ff7e4002728 Mon Sep 17 00:00:00 2001 From: Ganesh B Nalawade Date: Wed, 5 Dec 2018 08:44:14 +0530 Subject: [PATCH] Fix in dict_merge to check for Mapping * Based on review comments for PR #49474 change the check for isinstance from `dict` to `Mapping` --- lib/ansible/module_utils/network/common/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/network/common/utils.py b/lib/ansible/module_utils/network/common/utils.py index b1dde9685d..20bb5c4bae 100644 --- a/lib/ansible/module_utils/network/common/utils.py +++ b/lib/ansible/module_utils/network/common/utils.py @@ -37,6 +37,7 @@ from itertools import chain from socket import inet_aton 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.basic import AnsibleFallbackNotFound @@ -301,7 +302,7 @@ def dict_merge(base, other): if key in other: item = other.get(key) if item is not None: - if isinstance(other[key], dict): + if isinstance(other[key], Mapping): combined[key] = dict_merge(value, other[key]) else: combined[key] = other[key]