Update operations statuses
class OperationStatus(object):
CREATED = 'created'
SCHEDULED = 'scheduled'
- STARTED = 'started'
RUNNING = 'running'
SUCCESS = 'success'
FAILED = 'failed'
+ UPSTREAM_FAILED = 'upstream_failed'
STOPPED = 'stopped'
SKIPPED = 'skipped'
RETRYING = 'retrying'
- VALUES = [CREATED, STARTED, SCHEDULED, RUNNING, SUCCESS, FAILED, STOPPED, SKIPPED, RETRYING]
+ VALUES = [
+ CREATED, SCHEDULED, RUNNING, SUCCESS, FAILED, UPSTREAM_FAILED, STOPPED, SKIPPED, RETRYING
+ ]
CHOICES = (
(CREATED, CREATED),
(SCHEDULED, SCHEDULED),
- (STARTED, STARTED),
(RUNNING, RUNNING),
(SUCCESS, SUCCESS),
(FAILED, FAILED),
+ (UPSTREAM_FAILED, UPSTREAM_FAILED),
(STOPPED, STOPPED),
(SKIPPED, SKIPPED),
(RETRYING, RETRYING)
)
- DONE_STATUS = [SUCCESS, FAILED, STOPPED, SKIPPED]
+ DONE_STATUS = [SUCCESS, FAILED, UPSTREAM_FAILED, STOPPED, SKIPPED]
ALLOWED_VALUES = {
CREATED: set([]),
- SCHEDULED: {CREATED, },
- STARTED: {SCHEDULED, RETRYING, },
- RUNNING: {STARTED, },
+ SCHEDULED: {CREATED, RETRYING, },
+ RUNNING: {SCHEDULED, },
SUCCESS: {RUNNING, },
- FAILED: {SCHEDULED, STARTED, RUNNING, },
- STOPPED: {CREATED, SCHEDULED, STARTED, RUNNING, },
+ FAILED: {SCHEDULED, RUNNING, },
+ UPSTREAM_FAILED: set(VALUES),
+ STOPPED: {CREATED, SCHEDULED, RUNNING, },
SKIPPED: {CREATED, SCHEDULED, STOPPED, },
RETRYING: {SCHEDULED, FAILED, STOPPED, SKIPPED},
}
