all_hosts = [hs.hostname for hs in hostspecs]
return [h.hostname for h in self.hosts if h.hostname in all_hosts]
if self.label:
- return [hs.hostname for hs in hostspecs if self.label in hs.labels]
- all_hosts = [hs.hostname for hs in hostspecs]
+ all_hosts = [hs.hostname for hs in hostspecs if self.label in hs.labels]
+ else:
+ all_hosts = [hs.hostname for hs in hostspecs]
if self.host_pattern:
- return fnmatch.filter(all_hosts, self.host_pattern)
+ return self.host_pattern.filter_hosts(all_hosts)
return all_hosts
def get_target_count(self, hostspecs: Iterable[HostSpec]) -> int: