Commit 5652a625 by Guba Sándor

storage: fixed ready and added failed property

parent f165822b
......@@ -123,8 +123,18 @@ class Disk(AclBase, TimeStampedModel):
def ready(self):
""" Returns True if the disk is physically ready on the storage.
It needs at least 1 successfull deploy action.
return self.activity_log.filter(activity_code__endswith="deploy",
def failed(self):
""" Returns True if the last activity on the disk is failed.
return not self.activity_log.all().order_by('-id')[0].succeeded
def path(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