summaryrefslogtreecommitdiff
path: root/lib/ansible/inventory
diff options
context:
space:
mode:
authorSloane Hertel <19572925+s-hertel@users.noreply.github.com>2020-12-16 11:23:23 -0500
committerGitHub <noreply@github.com>2020-12-16 11:23:23 -0500
commit5e03e322de5b43b69c8aad5c0cb92e82ce0f3d17 (patch)
treec49e946bbf5b92238c2369c993a6e6c1801707a5 /lib/ansible/inventory
parent6487a239c0a085041a6c421bced5c354e4a94290 (diff)
downloadansible-5e03e322de5b43b69c8aad5c0cb92e82ce0f3d17.tar.gz
Pass the top level dictionaries to combine_vars (#72979)
* Pass the top level dictionaries to combine_vars combine_vars uses dict.update() to replace keys
Diffstat (limited to 'lib/ansible/inventory')
-rw-r--r--lib/ansible/inventory/group.py2
-rw-r--r--lib/ansible/inventory/host.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/inventory/group.py b/lib/ansible/inventory/group.py
index d3efb1d8fa..ed02fb4cca 100644
--- a/lib/ansible/inventory/group.py
+++ b/lib/ansible/inventory/group.py
@@ -247,7 +247,7 @@ class Group:
self.set_priority(int(value))
else:
if key in self.vars and isinstance(self.vars[key], MutableMapping) and isinstance(value, Mapping):
- self.vars[key] = combine_vars(self.vars[key], value)
+ self.vars = combine_vars(self.vars, {key: value})
else:
self.vars[key] = value
diff --git a/lib/ansible/inventory/host.py b/lib/ansible/inventory/host.py
index 7ad300790d..a3e41f53b6 100644
--- a/lib/ansible/inventory/host.py
+++ b/lib/ansible/inventory/host.py
@@ -143,7 +143,7 @@ class Host:
def set_variable(self, key, value):
if key in self.vars and isinstance(self.vars[key], MutableMapping) and isinstance(value, Mapping):
- self.vars[key] = combine_vars(self.vars[key], value)
+ self.vars = combine_vars(self.vars, {key: value})
else:
self.vars[key] = value