Use tenant_network if any in testcases after microversion v2.37
Now in testcases after microversion v2.37, if networks isn't passed
to create_test_server explicitly, no tenant_network will be retrieved
automatically, so they will always use networks='none'.
This is to use tenant_network if any be can found in testcases
after microversion v2.37 if networks='none' is not explicitly specified.
(if networks='none' is explictly specified, we should use it
prior to using tenant_network)
Change-Id: I0955e3507739e8e50384ba2cb2b56bd00b82750f
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index ac03cdc..8303963 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -176,11 +176,12 @@
cls.request_microversion)
v2_37_version = api_version_request.APIVersionRequest('2.37')
+ tenant_network = cls.get_tenant_network()
# NOTE(snikitin): since microversion v2.37 'networks' field is required
- if request_version >= v2_37_version and 'networks' not in kwargs:
+ if (request_version >= v2_37_version and 'networks' not in kwargs and
+ not tenant_network):
kwargs['networks'] = 'none'
- tenant_network = cls.get_tenant_network()
body, servers = compute.create_test_server(
cls.os_primary,
validatable,