mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00: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:
@@ -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())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user