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 4a4e7a6ebb
commit 4426b7f6e0

View file

@ -234,7 +234,7 @@ class VariableManager:
for item in data:
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':
for data in self._group_vars_files[group.name]:
data = preprocess_vars(data)
@ -604,4 +604,3 @@ class VariableManager:
if host_name not in self._vars_cache:
self._vars_cache[host_name] = dict()
self._vars_cache[host_name][varname] = value