Tempest: Fix cleaning of networks after API tests
In case when network was created with different than default
client (like admin_client) network wasn't properly removed in
cleanup_resources method because default client was used to
delete function and 'NotFound' error returned from Neutron
was silently ignored in such case.
Now networks created by different than default client are
added to "admin_networks" list and are cleaned by admin_client.
Change-Id: I52428262276c16dbe077fcf77b1890f12dccc97d
diff --git a/neutron/tests/tempest/api/base.py b/neutron/tests/tempest/api/base.py
index 207a30f..afcbe9c 100644
--- a/neutron/tests/tempest/api/base.py
+++ b/neutron/tests/tempest/api/base.py
@@ -224,7 +224,10 @@
client = client or cls.client
body = client.create_network(name=network_name, **kwargs)
network = body['network']
- cls.networks.append(network)
+ if client is cls.client:
+ cls.networks.append(network)
+ else:
+ cls.admin_networks.append(network)
return network
@classmethod