Commit 74bd1375 by Dudás Ádám

vm: fix legacy 'state' field reference

parent da9ac904
...@@ -137,7 +137,8 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -137,7 +137,8 @@ class InstanceTemplate(AclBase, VirtualMachineDescModel, TimeStampedModel):
def running_instances(self): def running_instances(self):
"""Returns the number of running instances of the template. """Returns the number of running instances of the template.
""" """
return self.instance_set.filter(state='RUNNING').count() return len([i for i in self.instance_set.all()
if i.state == 'RUNNING'])
@property @property
def os_type(self): def os_type(self):
......
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