mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix --limit for external inventory scripts, slight variant on fix from pull #949
This commit is contained in:
parent
4002cfbdcd
commit
4caf85e37b
1 changed files with 4 additions and 4 deletions
|
@ -114,11 +114,11 @@ class Inventory(object):
|
|||
positive_subsetp = [ p for p in self._subset if not p.startswith("!") ]
|
||||
negative_subsetp = [ p for p in self._subset if p.startswith("!") ]
|
||||
if len(positive_subsetp):
|
||||
positive_subset = self._get_hosts(positive_subsetp)
|
||||
hosts = [ h for h in hosts if (h in positive_subset) ]
|
||||
positive_subset = [ h.name for h in self._get_hosts(positive_subsetp) ]
|
||||
hosts = [ h for h in hosts if (h.name in positive_subset) ]
|
||||
if len(negative_subsetp):
|
||||
negative_subset = self._get_hosts(negative_subsetp)
|
||||
hosts = [ h for h in hosts if (h not in negative_subset)]
|
||||
negative_subset = [ h.name for h in self._get_hosts(negative_subsetp) ]
|
||||
hosts = [ h for h in hosts if (h.name not in negative_subset)]
|
||||
|
||||
# exclude hosts mentioned in any restriction (ex: failed hosts)
|
||||
if self._restriction is not None:
|
||||
|
|
Loading…
Reference in a new issue