mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Merge branch 'combine_vars' of git://github.com/laggyluke/ansible into exp
Conflicts: lib/ansible/inventory/vars_plugins/group_vars.py lib/ansible/runner/__init__.py lib/ansible/utils/__init__.py test/TestPlayBook.py
This commit is contained in:
commit
7c6341718e
9 changed files with 111 additions and 30 deletions
|
@ -318,7 +318,7 @@ def merge_hash(a, b):
|
|||
for k, v in b.iteritems():
|
||||
if k in a and isinstance(a[k], dict):
|
||||
# if this key is a hash and exists in a
|
||||
# we recursively call ourselves with
|
||||
# we recursively call ourselves with
|
||||
# the key value of b
|
||||
a[k] = merge_hash(a[k], v)
|
||||
else:
|
||||
|
@ -743,9 +743,10 @@ def listify_lookup_plugin_terms(terms, basedir, inject):
|
|||
|
||||
return terms
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def combine_vars(a, b):
|
||||
if C.DEFAULT_HASH_BEHAVIOUR == "merge":
|
||||
return merge_hash(a, b)
|
||||
else:
|
||||
return dict(a.items() + b.items())
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue