Merge "Adds server show in helpers"
This commit is contained in:
@@ -520,6 +520,14 @@ class InstanceHelperMixin:
|
|||||||
self.notifier.wait_for_versioned_notifications('instance.reboot.end')
|
self.notifier.wait_for_versioned_notifications('instance.reboot.end')
|
||||||
return self._wait_for_state_change(server, expected_state)
|
return self._wait_for_state_change(server, expected_state)
|
||||||
|
|
||||||
|
def _show_server(self, server):
|
||||||
|
"""This method is to retrieve fresh copy of target server object
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return self.api.get_server(server['id'])
|
||||||
|
except api_client.OpenStackApiNotFoundException:
|
||||||
|
return server
|
||||||
|
|
||||||
def _attach_interface(self, server, port_uuid):
|
def _attach_interface(self, server, port_uuid):
|
||||||
"""attach a neutron port to a server."""
|
"""attach a neutron port to a server."""
|
||||||
body = {
|
body = {
|
||||||
@@ -681,10 +689,9 @@ class InstanceHelperMixin:
|
|||||||
# wait for each vol to get attached
|
# wait for each vol to get attached
|
||||||
self._wait_for_volume_attach(server['id'], vol_id)
|
self._wait_for_volume_attach(server['id'], vol_id)
|
||||||
|
|
||||||
# here server is already in an active state
|
|
||||||
# this is just to refresh server object
|
# this is just to refresh server object
|
||||||
# so attached volumes can be shown in server
|
# so attached volumes can be shown in server
|
||||||
return self._wait_for_state_change(server, expected_status='ACTIVE')
|
return self._show_server(server)
|
||||||
|
|
||||||
def _create_vol_attachments_by_cinder(
|
def _create_vol_attachments_by_cinder(
|
||||||
self, volume_id, server, new_attachments=1):
|
self, volume_id, server, new_attachments=1):
|
||||||
|
Reference in New Issue
Block a user