aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/models.py
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2018-11-07 22:05:28 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-11-07 22:05:28 +0000
commit6a90796de1df8d74c79415c39c867ffe6cd80fd0 (patch)
treee192b4149cb535da0a8b928be65f2529a250b5ca /src/api/models.py
parentc589b15fbf1b5f386d0d6af453d2388e1a0ee1ad (diff)
parent7b15aed77c6675286fd75b8832af58c992717ef9 (diff)
Merge "Rewrite Notification subsystem"
Diffstat (limited to 'src/api/models.py')
-rw-r--r--src/api/models.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/api/models.py b/src/api/models.py
index 9afc89a..4237559 100644
--- a/src/api/models.py
+++ b/src/api/models.py
@@ -217,6 +217,18 @@ class Job(models.Model):
tasklist += list(cls.objects.filter(job=self).filter(status=status))
return tasklist
+ def is_fulfilled(self):
+ """
+ This method should return true if all of the job's tasks are done,
+ and false otherwise
+ """
+ my_tasks = self.get_tasklist()
+ for task in my_tasks:
+ if task.status != JobStatus.DONE:
+ return False
+ return True
+
+
def get_delta(self, status):
d = {}
j = {}