Skip to content

Commit

Permalink
ansible-test - Don't fail if network cannot be disconnected (#77472)
Browse files Browse the repository at this point in the history
* Don't fail if network cannot be disconnected

* add clog frag
  • Loading branch information
sivel committed Apr 6, 2022
1 parent 62fe471 commit 66c5844
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
@@ -0,0 +1,3 @@
bugfixes:
- ansible-test - Don't fail if network cannot be disconnected
(https://github.com/ansible/ansible/pull/77472)
9 changes: 8 additions & 1 deletion test/lib/ansible_test/_internal/delegation.py
Expand Up @@ -172,7 +172,14 @@ def delegate_command(args, host_state, exclude, require): # type: (EnvironmentC

if networks is not None:
for network in networks:
con.disconnect_network(network)
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.')
Expand Down

0 comments on commit 66c5844

Please sign in to comment.