Don't remove host vars when removing host from group

Don't remove host vars when removing host from group

Change-Id: Id645cde1e0f7734cd09c1e406e52f05635cc4c82
This commit is contained in:
Steve Noyes 2018-05-04 10:45:23 -04:00 committed by Borne Mace
parent 7c0bc714f1
commit 23bec78cd5
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