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): ...@@ -170,8 +170,9 @@ class OSVirtualMachineManager(InstanceInterface, OpenStackConnection):
self.openstack.compute.create_server_image(instance_id, self.openstack.compute.create_server_image(instance_id,
image_name, image_name,
metadata) metadata)
image = self.openstack.compute.find_image(image_name) image_id = self.openstack.compute.find_image(image_name)
return self.os_image_to_rc_image(image) image = self.openstack.image.get_image(image_id.id)
return self.os_image_to_rc_image(image)
def get_vnc_console(self, server_id): def get_vnc_console(self, server_id):
with client.Client("2", session=self.client_session) as nova: with client.Client("2", session=self.client_session) as nova:
...@@ -205,9 +206,11 @@ class OSVirtualMachineManager(InstanceInterface, OpenStackConnection): ...@@ -205,9 +206,11 @@ class OSVirtualMachineManager(InstanceInterface, OpenStackConnection):
launched_at=server.launched_at, launched_at=server.launched_at,
terminated_at=server.terminated_at, terminated_at=server.terminated_at,
addresses=server.addresses) addresses=server.addresses)
def os_image_to_rc_image(self, os_image): def os_image_to_rc_image(self, os_image):
return Image( return Image(
os_image.id, 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