Commit 79588613 by adamtorok

upgrades

parent 14670c78
...@@ -15,14 +15,23 @@ class OpenstackStorageManager(StorageManager): ...@@ -15,14 +15,23 @@ class OpenstackStorageManager(StorageManager):
def os_volume_to_rc_volume(os_volume): def os_volume_to_rc_volume(os_volume):
return Volume( return Volume(
os_volume.id, os_volume.id,
os_volume.image_id,
os_volume.size, os_volume.size,
os_volume.is_bootable, os_volume.is_bootable,
os_volume.status, os_volume.status,
os_volume.created_at os_volume.created_at
) )
def create(self, size, bootable): def create(self, size):
os_volume = self.openstack.block_storage.create_volume( os_volume = self.openstack.block_storage.create_volume(
size=size
)
return self.os_volume_to_rc_volume(os_volume)
def create_from_image(self, id, size, bootable):
os_volume = self.openstack.block_storage.create_volume(
image_id=id,
size=size, size=size,
bootable=bootable bootable=bootable
) )
...@@ -30,7 +39,9 @@ class OpenstackStorageManager(StorageManager): ...@@ -30,7 +39,9 @@ class OpenstackStorageManager(StorageManager):
return self.os_volume_to_rc_volume(os_volume) return self.os_volume_to_rc_volume(os_volume)
def create_from_snapshot(self, id): def create_from_snapshot(self, id):
os_volume = self.openstack.block_storage.create_volume(snapshot_id=id) os_volume = self.openstack.block_storage.create_volume(
snapshot_id=id
)
return self.os_volume_to_rc_volume(os_volume) return self.os_volume_to_rc_volume(os_volume)
......
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