Update job lifecycle add scheduled
@@ -21,6 +21,7 @@ class JobLifeCycle(BaseStatuses):
"""
CREATED = 'Created'
BUILDING = 'Building'
+ SCHEDULED = 'Scheduler'
RUNNING = 'Running'
SUCCEEDED = 'Succeeded'
FAILED = 'Failed'
@@ -30,6 +31,7 @@ class JobLifeCycle(BaseStatuses):
CHOICES = (
(CREATED, CREATED),
(BUILDING, BUILDING),
+ (SCHEDULED, SCHEDULED),
(RUNNING, RUNNING),
(SUCCEEDED, SUCCEEDED),
(FAILED, FAILED),
@@ -38,20 +40,21 @@ class JobLifeCycle(BaseStatuses):
)
VALUES = {
- CREATED, BUILDING, RUNNING, SUCCEEDED, FAILED, STOPPED, UNKNOWN
+ CREATED, BUILDING, SCHEDULED, RUNNING, SUCCEEDED, FAILED, STOPPED, UNKNOWN
}
STARTING_STATUS = {CREATED, BUILDING}
- RUNNING_STATUS = {BUILDING, RUNNING}
+ RUNNING_STATUS = {BUILDING, SCHEDULED, RUNNING}
DONE_STATUS = {FAILED, STOPPED, SUCCEEDED}
FAILED_STATUS = {FAILED, }
TRANSITION_MATRIX = {
CREATED: {None, },
BUILDING: {CREATED, },
- RUNNING: {CREATED, BUILDING, UNKNOWN},
+ SCHEDULED: {CREATED, BUILDING},
+ RUNNING: {CREATED, SCHEDULED, BUILDING, UNKNOWN},
SUCCEEDED: {CREATED, RUNNING, UNKNOWN, },
- FAILED: {CREATED, RUNNING, UNKNOWN, },
+ FAILED: {CREATED, BUILDING, SCHEDULED, RUNNING, UNKNOWN, },
STOPPED: set(VALUES),
UNKNOWN: set(VALUES),
}
