Commit f577b00d by Guba Sándor

storage: fixed disk create method

parent b644bc7c
...@@ -326,12 +326,9 @@ class Disk(AclBase, TimeStampedModel): ...@@ -326,12 +326,9 @@ class Disk(AclBase, TimeStampedModel):
:rtype: Disk :rtype: Disk
""" """
kwargs.setdefault('name', url.split('/')[-1]) kwargs.setdefault('name', url.split('/')[-1])
disk = cls(**kwargs) disk = Disk.create(type="iso", size=1, **kwargs)
disk.type = "iso"
disk.size = 1
# TODO get proper datastore # TODO get proper datastore
disk.datastore = DataStore.objects.get() disk.datastore = DataStore.objects.get()
disk.save()
if instance: if instance:
instance.disks.add(disk) instance.disks.add(disk)
queue_name = disk.get_remote_queue_name('storage') queue_name = disk.get_remote_queue_name('storage')
......
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