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:
Michael DeHaan 2013-04-16 20:06:06 -04:00
commit 7c6341718e
9 changed files with 111 additions and 30 deletions

View file

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