summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2016-02-22 10:39:09 -0500
committerJames Cammarata <jimi@sngx.net>2016-02-22 10:39:09 -0500
commitf36896b2bba1399846085cdaca3ecbd1966d9462 (patch)
tree5158b40deffc3aa6301fb39f530070bc6ef7de04
parent1e0cf69b1c554ac071ce8fb54ca910a202186baf (diff)
parentaeaddc555960eb94ca04a4c34be2780caa472187 (diff)
downloadansible-f36896b2bba1399846085cdaca3ecbd1966d9462.tar.gz
Merge pull request #14562 from dagwieers/combine_vars_backport
Backport combine_vars() logic from Ansible v2.0
-rw-r--r--lib/ansible/utils/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py
index 0c06df2f8e..07bbeb1d6c 100644
--- a/lib/ansible/utils/__init__.py
+++ b/lib/ansible/utils/__init__.py
@@ -1504,12 +1504,13 @@ def listify_lookup_plugin_terms(terms, basedir, inject):
def combine_vars(a, b):
- _validate_both_dicts(a, b)
-
if C.DEFAULT_HASH_BEHAVIOUR == "merge":
return merge_hash(a, b)
else:
- return dict(a.items() + b.items())
+ _validate_both_dicts(a, b)
+ result = a.copy()
+ result.update(b)
+ return result
def random_password(length=20, chars=C.DEFAULT_PASSWORD_CHARS):
'''Return a random password string of length containing only chars.'''