|
|
|
@ -178,8 +178,7 @@ class Inventory(object):
|
|
|
|
if self._restriction:
|
|
|
|
if self._restriction:
|
|
|
|
pattern_hash += u":%s" % to_unicode(self._restriction)
|
|
|
|
pattern_hash += u":%s" % to_unicode(self._restriction)
|
|
|
|
|
|
|
|
|
|
|
|
if pattern_hash in HOSTS_PATTERNS_CACHE:
|
|
|
|
if pattern_hash not in HOSTS_PATTERNS_CACHE:
|
|
|
|
return HOSTS_PATTERNS_CACHE[pattern_hash][:]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
patterns = Inventory.split_host_pattern(pattern)
|
|
|
|
patterns = Inventory.split_host_pattern(pattern)
|
|
|
|
hosts = self._evaluate_patterns(patterns)
|
|
|
|
hosts = self._evaluate_patterns(patterns)
|
|
|
|
@ -196,6 +195,7 @@ class Inventory(object):
|
|
|
|
hosts = [ h for h in hosts if h in self._restriction ]
|
|
|
|
hosts = [ h for h in hosts if h in self._restriction ]
|
|
|
|
|
|
|
|
|
|
|
|
HOSTS_PATTERNS_CACHE[pattern_hash] = list(set(hosts))
|
|
|
|
HOSTS_PATTERNS_CACHE[pattern_hash] = list(set(hosts))
|
|
|
|
|
|
|
|
|
|
|
|
return HOSTS_PATTERNS_CACHE[pattern_hash][:]
|
|
|
|
return HOSTS_PATTERNS_CACHE[pattern_hash][:]
|
|
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
@classmethod
|
|
|
|
|