Commit 7a1145f9 by Bodor Máté

Fix create image return value

parent 1a19e435
Pipeline #832 failed with stage
in 49 seconds
......@@ -170,8 +170,9 @@ class OSVirtualMachineManager(InstanceInterface, OpenStackConnection):
self.openstack.compute.create_server_image(instance_id,
image_name,
metadata)
image = self.openstack.compute.find_image(image_name)
return self.os_image_to_rc_image(image)
image_id = self.openstack.compute.find_image(image_name)
image = self.openstack.image.get_image(image_id.id)
return self.os_image_to_rc_image(image)
def get_vnc_console(self, server_id):
with client.Client("2", session=self.client_session) as nova:
......@@ -205,9 +206,11 @@ class OSVirtualMachineManager(InstanceInterface, OpenStackConnection):
launched_at=server.launched_at,
terminated_at=server.terminated_at,
addresses=server.addresses)
def os_image_to_rc_image(self, os_image):
return Image(
os_image.id,
os_image.name
os_image.name,
os_image.disk_format,
os_image.size
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment