ansible-test - Fix origin host target filtering.

pull/77426/head
Matt Clay 4 years ago
parent 6d260ad967
commit 4b51e61645

@ -0,0 +1,5 @@
bugfixes:
- ansible-test - Correctly detect when running as the ``root`` user (UID 0) on the origin host.
The result of the detection was incorrectly being inverted.
- ansible-test - Fix skipping of tests marked ``needs/root`` on the origin host.
- ansible-test - Fix skipping of tests marked ``needs/python`` on the origin host.

@ -221,7 +221,7 @@ class NetworkInventoryTargetFilter(TargetFilter[NetworkInventoryConfig]):
"""Target filter for network inventory.""" """Target filter for network inventory."""
class OriginTargetFilter(TargetFilter[OriginConfig]): class OriginTargetFilter(PosixTargetFilter[OriginConfig]):
"""Target filter for localhost.""" """Target filter for localhost."""

@ -419,7 +419,7 @@ class OriginConfig(ControllerHostConfig, PosixConfig):
@property @property
def have_root(self): # type: () -> bool def have_root(self): # type: () -> bool
"""True if root is available, otherwise False.""" """True if root is available, otherwise False."""
return os.getuid() != 0 return os.getuid() == 0
@dataclasses.dataclass @dataclasses.dataclass

Loading…
Cancel
Save