From 23bec78cd5273517d65b117eddb63f59fb17f8bd Mon Sep 17 00:00:00 2001 From: Steve Noyes Date: Fri, 4 May 2018 10:45:23 -0400 Subject: [PATCH] Don't remove host vars when removing host from group Don't remove host vars when removing host from group Change-Id: Id645cde1e0f7734cd09c1e406e52f05635cc4c82 --- kolla_cli/common/inventory.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kolla_cli/common/inventory.py b/kolla_cli/common/inventory.py index 5e6dea1..b7d4666 100644 --- a/kolla_cli/common/inventory.py +++ b/kolla_cli/common/inventory.py @@ -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