[stable-2.13] ansible-test - Don't fail if network cannot be disconnected (#77472) (#77482)

* Don't fail if network cannot be disconnected

* add clog frag
(cherry picked from commit 66c5844)

Co-authored-by: Matt Martz <matt@sivel.net>
pull/77488/head
Matt Martz 3 years ago committed by GitHub
parent 3b20b02272
commit 30f96bb75e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,3 @@
bugfixes:
- ansible-test - Don't fail if network cannot be disconnected
(https://github.com/ansible/ansible/pull/77472)

@ -172,7 +172,14 @@ def delegate_command(args, host_state, exclude, require): # type: (EnvironmentC
if networks is not None:
for network in networks:
try:
con.disconnect_network(network)
except SubprocessError:
display.warning(
'Unable to disconnect network "%s" (this is normal under podman). '
'Tests will not be isolated from the network. Network-related tests may '
'misbehave.' % (network,)
)
else:
display.warning('Network disconnection is not supported (this is normal under podman). '
'Tests will not be isolated from the network. Network-related tests may misbehave.')

Loading…
Cancel
Save