Commit ac493847 by Guba Sándor

added self.base.is_ready check

parent 5c0672bc
......@@ -320,6 +320,8 @@ class Disk(AclBase, TimeStampedModel):
if self.is_ready:
return True
if self.base and not self.base.is_ready:
raise Exception("Base image is not ready.")
queue_name = self.get_remote_queue_name('storage', priority="fast")
disk_desc = self.get_disk_desc()
if self.base is not None:
......@@ -440,7 +442,7 @@ class Disk(AclBase, TimeStampedModel):
disk = Disk.create(datastore=self.datastore,
base=new_base,
name=self.name, size=self.size,
type=new_type)
type=new_type, dev_num=self.dev_num)
queue_name = self.get_remote_queue_name("storage", priority="slow")
remote = storage_tasks.merge.apply_async(kwargs={
......@@ -457,4 +459,6 @@ class Disk(AclBase, TimeStampedModel):
AbortableAsyncResult(remote.id).abort()
disk.destroy()
raise Exception("Save as aborted by use.")
disk.is_ready = True
disk.save()
return disk
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