Make add_host clear the inventory pattern cache, add some more aliases. Fixes #4442.

This commit is contained in:
Michael DeHaan 2013-10-11 16:36:48 -04:00
commit 41aaad69aa
3 changed files with 12 additions and 4 deletions

View file

@ -266,6 +266,10 @@ class Inventory(object):
self._pattern_hosts[pattern] = results
return self._pattern_hosts[pattern]
def clear_pattern_cache(self):
''' called exclusively by the add_host plugin to allow patterns to be recalculated '''
self._pattern_hosts = {}
def groups_for_host(self, host):
results = []
groups = self.get_groups()