Fix use of get_server_ip with fixed networks
If a fixed network is used, we see errors like the following in three
compute tests:
KeyError: 'addresses'
This is because get_server_ip expects to be called with a detailed
server response, but in these cases is called with a create server
response, which does not contain the 'addresses' field.
This change fixes the issue by obtaining a detailed server response
where necessary.
Change-Id: I9deeb0e527a8537c71657507cabd81a63a421d9c
Closes-Bug: #1817701
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index d47ff51..0e469c7 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -345,6 +345,9 @@
# from setUp is not volume-backed.
server = self.create_test_server(
volume_backed=True, wait_until='ACTIVE')
+ # NOTE(mgoddard): Get detailed server to ensure addresses are present
+ # in fixed IP case.
+ server = self.servers_client.show_server(server['id'])['server']
self._test_resize_server_confirm(server['id'])
if CONF.compute_feature_enabled.console_output:
# Now do something interactive with the guest like get its console