Commit 4b7acc4e by Bodor Máté

Add size attribute to Image

parent abe7a473
Pipeline #790 failed with stage
in 41 seconds
...@@ -14,7 +14,8 @@ class OpenstackImageManager(ImageManager, OpenStackConnection): ...@@ -14,7 +14,8 @@ class OpenstackImageManager(ImageManager, OpenStackConnection):
return Image( return Image(
os_image.id, os_image.id,
os_image.name, os_image.name,
os_image.disk_format os_image.disk_format,
os_image.size
) )
def upload_file(self, name, path, format) -> Image: def upload_file(self, name, path, format) -> Image:
......
...@@ -2,12 +2,13 @@ import json ...@@ -2,12 +2,13 @@ import json
class Image: class Image:
def __init__(self, id, name, format=None) -> None: def __init__(self, id, name, file_format, size) -> None:
super().__init__() super().__init__()
self.id = id self.id = id
self.name = name self.name = name
self.format = format self.file_format = file_format
self.size = size
def __str__(self) -> str: def __str__(self) -> str:
return self.toJSON() return self.toJSON()
......
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