ansible-test - Fix traceback on multiple win remotes (#86591)

pull/86592/head
Matt Clay 3 months ago committed by GitHub
parent 4ae2ccbc8f
commit fbe9d7f32a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- ansible-test - Fix traceback when requesting windows integration tests for multiple managed hosts.

@ -55,6 +55,11 @@ class TargetFilter[THostConfig: HostConfig](metaclass=abc.ABCMeta):
self.allow_root = args.allow_root
self.allow_destructive = args.allow_destructive
@property
def is_managed(self) -> bool:
"""True if all configs are managed, otherwise False."""
return all(config.is_managed for config in self.configs)
@property
def config(self) -> THostConfig:
"""The configuration to filter. Only valid when there is a single config."""
@ -104,7 +109,7 @@ class TargetFilter[THostConfig: HostConfig](metaclass=abc.ABCMeta):
elif reason == FallbackReason.PYTHON:
display.warning(f'Some {self.host_type} tests may be redundant since a fallback python is in use: {", ".join(affected_targets)}')
if not self.allow_destructive and not self.config.is_managed:
if not self.allow_destructive and not self.is_managed:
override_destructive = set(target for target in self.include_targets if target.startswith('destructive/'))
override = [target.name for target in targets if override_destructive & set(target.aliases)]

Loading…
Cancel
Save