Merge "Don't remove host vars when removing host from group"

This commit is contained in:
Zuul 2018-05-24 22:58:29 +00:00 committed by Gerrit Code Review
commit 928b4a2ae7
1 changed files with 3 additions and 4 deletions

View File

@ -225,11 +225,10 @@ class Inventory(object):
if not groupname or groupname == group.name:
group.remove_host(host)
host_vars = os.path.join(get_host_vars_dir(), hostname)
if os.path.exists(host_vars):
os.remove(host_vars)
if not groupname:
host_vars = os.path.join(get_host_vars_dir(), hostname)
if os.path.exists(host_vars):
os.remove(host_vars)
del self._hosts[hostname]
return changed