summaryrefslogtreecommitdiff
path: root/nova/tests/functional/integrated_helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'nova/tests/functional/integrated_helpers.py')
-rw-r--r--nova/tests/functional/integrated_helpers.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/nova/tests/functional/integrated_helpers.py b/nova/tests/functional/integrated_helpers.py
index d55267c410..3313abb414 100644
--- a/nova/tests/functional/integrated_helpers.py
+++ b/nova/tests/functional/integrated_helpers.py
@@ -363,13 +363,25 @@ class InstanceHelperMixin(object):
"""
# if forcing the server onto a host, we have to use the admin API
if not api:
- api = self.api if not az else getattr(self, 'admin_api', self.api)
+ api = self.api if not az and not host else getattr(
+ self, 'admin_api', self.api)
+
+ microversion = api.microversion
+ if host and not api.microversion:
+ api.microversion = '2.74'
+ # with 2.74 networks param needs to use 'none' instead of None
+ # if no network is needed
+ if networks is None:
+ networks = 'none'
body = self._build_server(
name, image_uuid, flavor_id, networks, az, host)
server = api.post_server({'server': body})
+ # Reset API microversion to original state
+ api.microversion = microversion
+
return self._wait_for_state_change(server, expected_state)
def _delete_server(self, server):