summaryrefslogtreecommitdiff
path: root/src/buildstream/_scheduler
diff options
context:
space:
mode:
authorAngelos Evripiotis <jevripiotis@bloomberg.net>2019-06-06 11:20:44 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-06-06 16:49:36 +0000
commitb216febd888f2b7ab763db0045ac5736d0a9a16a (patch)
tree217c81a8f538478c3d665e032f1ad63c475687ea /src/buildstream/_scheduler
parent63152f6c1dd4f7aea1e85cd5e334bd73952aa09d (diff)
downloadbuildstream-b216febd888f2b7ab763db0045ac5736d0a9a16a.tar.gz
_scheduler/jobs/job: make JobStatus an enum
This provides some minor guards against mistakes, and we'll be able to do type-checking later. This does open the possibility of problems if folks mistakenly try to pass off an integer as a JobStatus.
Diffstat (limited to 'src/buildstream/_scheduler')
-rw-r--r--src/buildstream/_scheduler/jobs/job.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buildstream/_scheduler/jobs/job.py b/src/buildstream/_scheduler/jobs/job.py
index 0ef316028..ed90bb3a4 100644
--- a/src/buildstream/_scheduler/jobs/job.py
+++ b/src/buildstream/_scheduler/jobs/job.py
@@ -50,7 +50,8 @@ class _ReturnCode(enum.IntEnum):
# The job completion status, passed back through the
# complete callbacks.
#
-class JobStatus():
+@enum.unique
+class JobStatus(enum.Enum):
# Job succeeded
OK = 0