Fix race in test_networks.py: don't try to get a possibly-deleted network
In compute/admin/test_networks.py, acting as admin, we can list all
networks created by all projects. *But* we can't get (display details)
for one of these networks because by the time we try to GET that network
it could have been deleted.
The fix tries to GET a known/existing-for-sure/permanent network.
Change-Id: If8365dffc84709ad517b40d205729e4a543ceccb
diff --git a/tempest/api/compute/admin/test_networks.py b/tempest/api/compute/admin/test_networks.py
index e5c8790..8504840 100644
--- a/tempest/api/compute/admin/test_networks.py
+++ b/tempest/api/compute/admin/test_networks.py
@@ -42,8 +42,12 @@
"{0} networks with label {1}".format(
len(configured_network),
CONF.compute.fixed_network_name))
+ elif CONF.network.public_network_id:
+ configured_network = [x for x in networks if x['id'] ==
+ CONF.network.public_network_id]
else:
- configured_network = networks
+ raise self.skipException(
+ "Environment has no known-for-sure existing network.")
configured_network = configured_network[0]
network = (self.client.show_network(configured_network['id'])
['network'])