fix for dynamic (add_host) hosts not available in hostvars

Looks like there are two pattern caches that need to be cleared for this to work- added the second one.
Added integration tests for add_host to prevent future regressions.
This commit is contained in:
nitzmahone 2015-11-16 10:53:10 -08:00
commit 349e072a74
3 changed files with 42 additions and 0 deletions

View file

@ -455,6 +455,8 @@ class Inventory(object):
def clear_pattern_cache(self):
''' called exclusively by the add_host plugin to allow patterns to be recalculated '''
global HOSTS_PATTERNS_CACHE
HOSTS_PATTERNS_CACHE = {}
self._pattern_cache = {}
def groups_for_host(self, host):