clear correct cache when reconcile is invoked

moved it to ensure all callers get the correct hosts after

(cherry picked from commit fc9b44e021)
This commit is contained in:
Brian Coca 2017-09-15 15:13:43 -04:00 committed by Toshio Kuratomi
parent eeba998592
commit a725b62f51
2 changed files with 1 additions and 4 deletions

View file

@ -168,6 +168,7 @@ class InventoryManager(object):
return self._inventory.get_groups_dict() return self._inventory.get_groups_dict()
def reconcile_inventory(self): def reconcile_inventory(self):
self.clear_caches()
return self._inventory.reconcile_inventory() return self._inventory.reconcile_inventory()
def get_host(self, hostname): def get_host(self, hostname):

View file

@ -615,9 +615,6 @@ class StrategyBase:
new_group = self._inventory.groups[group_name] new_group = self._inventory.groups[group_name]
new_group.add_host(self._inventory.hosts[host_name]) new_group.add_host(self._inventory.hosts[host_name])
# clear pattern caching completely since it's unpredictable what patterns may have referenced the group
self._inventory.clear_pattern_cache()
# reconcile inventory, ensures inventory rules are followed # reconcile inventory, ensures inventory rules are followed
self._inventory.reconcile_inventory() self._inventory.reconcile_inventory()
@ -655,7 +652,6 @@ class StrategyBase:
changed = True changed = True
if changed: if changed:
self._inventory.clear_pattern_cache()
self._inventory.reconcile_inventory() self._inventory.reconcile_inventory()
return changed return changed