Commit 92fa13aa by Guba Sándor

instance: added InstanceTemplate is_ready property

parent fc942a00
...@@ -151,6 +151,10 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -151,6 +151,10 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel):
else: else:
return 'linux' return 'linux'
@property
def is_ready(self):
return all(disk.is_ready for disk in self.disks)
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
is_new = getattr(self, "pk", None) is None is_new = getattr(self, "pk", None) is None
super(InstanceTemplate, self).save(*args, **kwargs) super(InstanceTemplate, self).save(*args, **kwargs)
......
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