From b12ca95824b139598ff51f34bc0904a2105d31ff Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sun, 25 Jun 2017 18:46:41 -0400 Subject: [PATCH] renames dict_combine to dict_merge in network_common (#26073) --- lib/ansible/module_utils/network_common.py | 4 ++-- test/units/module_utils/test_network_common.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/module_utils/network_common.py b/lib/ansible/module_utils/network_common.py index 32d831b88ff..485fa947f48 100644 --- a/lib/ansible/module_utils/network_common.py +++ b/lib/ansible/module_utils/network_common.py @@ -227,7 +227,7 @@ def dict_diff(base, comparable): return updates -def dict_combine(base, other): +def dict_merge(base, other): """ Return a new dict object that combines base and other This will create a new dict object that is a combination of the key/value @@ -250,7 +250,7 @@ def dict_combine(base, other): if key in other: item = other.get(key) if item is not None: - combined[key] = dict_combine(value, other[key]) + combined[key] = dict_merge(value, other[key]) else: combined[key] = item else: diff --git a/test/units/module_utils/test_network_common.py b/test/units/module_utils/test_network_common.py index 1d3c323a7cc..706eb62b7b1 100644 --- a/test/units/module_utils/test_network_common.py +++ b/test/units/module_utils/test_network_common.py @@ -24,7 +24,7 @@ __metaclass__ = type from ansible.compat.tests import unittest from ansible.module_utils.network_common import to_list, sort_list -from ansible.module_utils.network_common import dict_diff, dict_combine +from ansible.module_utils.network_common import dict_diff, dict_merge class TestModuleUtilsNetworkCommon(unittest.TestCase): @@ -87,7 +87,7 @@ class TestModuleUtilsNetworkCommon(unittest.TestCase): self.assertTrue(result['b3']) self.assertTrue(result['b4']) - def test_dict_combine(self): + def test_dict_merge(self): base = dict(obj2=dict(), b1=True, b2=False, b3=False, one=1, two=2, three=3, obj1=dict(key1=1, key2=2), l1=[1, 3], l2=[1, 2, 3], l4=[4], @@ -98,7 +98,7 @@ class TestModuleUtilsNetworkCommon(unittest.TestCase): l1=[2, 1], l2=[3, 2, 1], l3=[1], nested=dict(n1=dict(n2=2, n3=3))) - result = dict_combine(base, other) + result = dict_merge(base, other) # string assertions self.assertIn('one', result)