fix sorting of groups for host vars

Fixes #13371
This commit is contained in:
James Cammarata 2015-12-03 14:22:27 -05:00
parent 0d0ed35ba4
commit 013ace9ab2

View file

@ -234,7 +234,7 @@ class VariableManager:
for item in data: for item in data:
all_vars = combine_vars(all_vars, item) all_vars = combine_vars(all_vars, item)
for group in host.get_groups(): for group in sorted(host.get_groups(), key=lambda g: g.depth):
if group.name in self._group_vars_files and group.name != 'all': if group.name in self._group_vars_files and group.name != 'all':
for data in self._group_vars_files[group.name]: for data in self._group_vars_files[group.name]:
data = preprocess_vars(data) data = preprocess_vars(data)
@ -604,4 +604,3 @@ class VariableManager:
if host_name not in self._vars_cache: if host_name not in self._vars_cache:
self._vars_cache[host_name] = dict() self._vars_cache[host_name] = dict()
self._vars_cache[host_name][varname] = value self._vars_cache[host_name][varname] = value