avoid set to unique hosts to preserver order
swiched to using a list comp and set to still unique but keep expected order fixes #13522
This commit is contained in:
parent
de71171fc2
commit
ae988ed753
1 changed files with 2 additions and 1 deletions
|
@ -194,7 +194,8 @@ class Inventory(object):
|
||||||
if self._restriction is not None:
|
if self._restriction is not None:
|
||||||
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))
|
seen = set()
|
||||||
|
HOSTS_PATTERNS_CACHE[pattern_hash] = [x for x in hosts if x not in seen and not seen.add(x)]
|
||||||
|
|
||||||
return HOSTS_PATTERNS_CACHE[pattern_hash][:]
|
return HOSTS_PATTERNS_CACHE[pattern_hash][:]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue