Tweaked merge_hash to also affect Runner behavior

This commit is contained in:
George Miroshnykov 2013-03-10 01:30:18 +02:00
parent 94d189bc7f
commit 6826aa7360
9 changed files with 110 additions and 23 deletions

View file

@ -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())