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
pull/73003/head
Sloane Hertel 4 years ago committed by GitHub
parent 6487a239c0
commit 5e03e322de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- inventory - pass the vars dictionary to combine_vars instead of an individual key's value (https://github.com/ansible/ansible/issues/72975).

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

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

Loading…
Cancel
Save