mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Tweaked merge_hash to also affect Runner behavior
This commit is contained in:
parent
94d189bc7f
commit
6826aa7360
9 changed files with 110 additions and 23 deletions
|
@ -306,7 +306,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:
|
||||
|
@ -663,8 +663,13 @@ def get_diff(diff):
|
|||
return ">> the files are different, but the diff library cannot compare unicode strings"
|
||||
|
||||
def is_list_of_strings(items):
|
||||
for x in items:
|
||||
for x in items:
|
||||
if not isinstance(x, basestring):
|
||||
return False
|
||||
return True
|
||||
|
||||
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