Improve Task status list
* Rename old task statuses to the new one "verifying" to "validating", "failed" to "crashed" * Change the type of the status field from the enum to the string in Task and SubTask models Co-Authored-By: Boris Pavlovic <boris@pavlovic.me> Co-Authored-By: Roman Vasilets <rvasilets@mirantis.com> Change-Id: I3071bd42d9096cb14e6a3c228e1c8dfec81e9c12
This commit is contained in:
parent
a1a5e6a079
commit
e9b4eb5a2e
@ -28,36 +28,37 @@ JSON_SCHEMA = "http://json-schema.org/draft-04/schema"
|
|||||||
|
|
||||||
|
|
||||||
class _TaskStatus(utils.ImmutableMixin, utils.EnumMixin):
|
class _TaskStatus(utils.ImmutableMixin, utils.EnumMixin):
|
||||||
# TODO(ikhudoshyn): new statuses
|
|
||||||
# INIT = "init"
|
|
||||||
# VALIDATING = "validating"
|
|
||||||
# VALIDATED = "validated"
|
|
||||||
# VALIDATION_FAILED = "validation_failed"
|
|
||||||
# ABORTING = "aborting"
|
|
||||||
# SOFT_ABORTING = "soft_aborting"
|
|
||||||
# ABORTED = "aborted"
|
|
||||||
# CRASHED = "crashed"
|
|
||||||
# RUNNING = "running"
|
|
||||||
# FINISHED = "finished"
|
|
||||||
|
|
||||||
# TODO(ikhudoshyn): deprecated statuses
|
"""Consts that represents task possible states."""
|
||||||
INIT = "init"
|
INIT = "init"
|
||||||
VERIFYING = "verifying"
|
VALIDATING = "validating"
|
||||||
SETTING_UP = "setting up"
|
VALIDATED = "validated"
|
||||||
|
VALIDATION_FAILED = "validation_failed"
|
||||||
RUNNING = "running"
|
RUNNING = "running"
|
||||||
CLEANING_UP = "cleaning up"
|
|
||||||
FINISHED = "finished"
|
FINISHED = "finished"
|
||||||
FAILED = "failed"
|
CRASHED = "crashed"
|
||||||
ABORTING = "aborting"
|
ABORTING = "aborting"
|
||||||
|
SLA_FAILED = "sla_failed"
|
||||||
SOFT_ABORTING = "soft_aborting"
|
SOFT_ABORTING = "soft_aborting"
|
||||||
ABORTED = "aborted"
|
ABORTED = "aborted"
|
||||||
PAUSED = "paused"
|
PAUSED = "paused"
|
||||||
|
|
||||||
|
|
||||||
class _SubtaskStatus(utils.ImmutableMixin, utils.EnumMixin):
|
class _SubtaskStatus(utils.ImmutableMixin, utils.EnumMixin):
|
||||||
|
|
||||||
|
"""Consts that represents task possible states."""
|
||||||
|
INIT = "init"
|
||||||
|
VALIDATING = "validating"
|
||||||
|
VALIDATED = "validated"
|
||||||
|
VALIDATION_FAILED = "validation_failed"
|
||||||
RUNNING = "running"
|
RUNNING = "running"
|
||||||
FINISHED = "finished"
|
FINISHED = "finished"
|
||||||
CRASHED = "crashed"
|
CRASHED = "crashed"
|
||||||
|
ABORTING = "aborting"
|
||||||
|
SLA_FAILED = "sla_failed"
|
||||||
|
SOFT_ABORTING = "soft_aborting"
|
||||||
|
ABORTED = "aborted"
|
||||||
|
PAUSED = "paused"
|
||||||
|
|
||||||
|
|
||||||
class _DeployStatus(utils.ImmutableMixin, utils.EnumMixin):
|
class _DeployStatus(utils.ImmutableMixin, utils.EnumMixin):
|
||||||
|
@ -373,7 +373,7 @@ class TaskTestCase(unittest.TestCase):
|
|||||||
self.assertIn("finished", rally("task list --deployment MAIN"))
|
self.assertIn("finished", rally("task list --deployment MAIN"))
|
||||||
|
|
||||||
self.assertIn("There are no tasks",
|
self.assertIn("There are no tasks",
|
||||||
rally("task list --status failed"))
|
rally("task list --status crashed"))
|
||||||
|
|
||||||
self.assertIn("finished", rally("task list --status finished"))
|
self.assertIn("finished", rally("task list --status finished"))
|
||||||
|
|
||||||
|
@ -1834,6 +1834,7 @@ class FakeTask(dict):
|
|||||||
self.is_temporary = temporary
|
self.is_temporary = temporary
|
||||||
self.task = task or kwargs
|
self.task = task or kwargs
|
||||||
self.set_failed = mock.Mock()
|
self.set_failed = mock.Mock()
|
||||||
|
self.set_validation_failed = mock.Mock()
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
if key in self:
|
if key in self:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user