mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #13444 from n-st/duplicate-host-bugfix
Bugfix: Remove duplicates from host list *before* caching it
This commit is contained in:
commit
dbdfb1f6f3
1 changed files with 2 additions and 2 deletions
|
@ -195,8 +195,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] = hosts[:]
|
HOSTS_PATTERNS_CACHE[pattern_hash] = list(set(hosts))
|
||||||
return list(set(hosts))
|
return HOSTS_PATTERNS_CACHE[pattern_hash][:]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def split_host_pattern(cls, pattern):
|
def split_host_pattern(cls, pattern):
|
||||||
|
|
Loading…
Reference in a new issue