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

Merge pull request #12177 from mgedmin/py3k

Make combine_vars() compatible with Python 3
This commit is contained in:
Toshio Kuratomi 2015-09-01 08:00:08 -07:00
commit 12edbfeb0b
2 changed files with 6 additions and 2 deletions

View file

@ -32,7 +32,9 @@ def combine_vars(a, b):
if C.DEFAULT_HASH_BEHAVIOUR == "merge":
return merge_hash(a, b)
else:
return dict(a.items() + b.items())
result = a.copy()
result.update(b)
return result
def merge_hash(a, b):
''' recursively merges hash b into a

View file

@ -121,7 +121,9 @@ class VariableManager:
if C.DEFAULT_HASH_BEHAVIOUR == "merge":
return self._merge_dicts(a, b)
else:
return dict(a.items() + b.items())
result = a.copy()
result.update(b)
return result
def _merge_dicts(self, a, b):
'''