Commit a7259472 by Bach Dániel

vm: call {disk,instance}.full_clean() in {CreateDisk,DownloadDisk}Operations

parent 6b4499cc
...@@ -120,6 +120,7 @@ class CreateDiskOperation(InstanceOperation): ...@@ -120,6 +120,7 @@ class CreateDiskOperation(InstanceOperation):
if not name: if not name:
name = "new disk" name = "new disk"
disk = Disk.create(size=size, name=name, type="qcow2-norm") disk = Disk.create(size=size, name=name, type="qcow2-norm")
disk.full_clean()
self.instance.disks.add(disk) self.instance.disks.add(disk)
register_operation(CreateDiskOperation) register_operation(CreateDiskOperation)
...@@ -146,6 +147,7 @@ class DownloadDiskOperation(InstanceOperation): ...@@ -146,6 +147,7 @@ class DownloadDiskOperation(InstanceOperation):
from storage.models import Disk from storage.models import Disk
disk = Disk.download(url=url, name=name, task=task) disk = Disk.download(url=url, name=name, task=task)
disk.full_clean()
self.instance.disks.add(disk) self.instance.disks.add(disk)
register_operation(DownloadDiskOperation) register_operation(DownloadDiskOperation)
...@@ -663,6 +665,7 @@ class ResourcesOperation(InstanceOperation): ...@@ -663,6 +665,7 @@ class ResourcesOperation(InstanceOperation):
self.instance.max_ram_size = max_ram_size self.instance.max_ram_size = max_ram_size
self.instance.priority = priority self.instance.priority = priority
self.instance.full_clean()
self.instance.save() self.instance.save()
......
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