"_log_ns_network_status" log if namespace does not exist
During the capture of the host network configuration, if a namespace
is deleted, the method "_log_ns_network_status" will not fail but log
that this namespace has been deleted synchronously.
Change-Id: I54bf4374f43c3e830129fd9ce0b2d2503c26f886
Closes-Bug: #1904544
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index c7c5459..e9ec5a4 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -307,13 +307,19 @@
self._log_ns_network_status(ns_name=ns_name)
def _log_ns_network_status(self, ns_name=None):
- local_ips = ip_utils.IPCommand(namespace=ns_name).list_addresses()
+ try:
+ local_ips = ip_utils.IPCommand(namespace=ns_name).list_addresses()
+ local_routes = ip_utils.IPCommand(namespace=ns_name).list_routes()
+ arp_table = ip_utils.arp_table()
+ except exceptions.ShellCommandFailed:
+ LOG.debug('Namespace %s has been deleted synchronously during the '
+ 'host network collection process', ns_name)
+ return
+
LOG.debug('Namespace %s; IP Addresses:\n%s',
ns_name, '\n'.join(str(r) for r in local_ips))
- local_routes = ip_utils.IPCommand(namespace=ns_name).list_routes()
LOG.debug('Namespace %s; Local routes:\n%s',
ns_name, '\n'.join(str(r) for r in local_routes))
- arp_table = ip_utils.arp_table()
LOG.debug('Namespace %s; Local ARP table:\n%s',
ns_name, '\n'.join(str(r) for r in arp_table))