summaryrefslogtreecommitdiff
path: root/taskflow/states.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2015-06-17 11:28:57 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2015-07-10 18:12:48 -0700
commita3fe3eb698e7bfa20b0b7fddd91c37a44c092f2c (patch)
treeac21cb738503b555f75e756397539c043524d799 /taskflow/states.py
parent5fb62f3864e4a35d6b5e9401e9aa2b94b28d7c58 (diff)
downloadtaskflow-a3fe3eb698e7bfa20b0b7fddd91c37a44c092f2c.tar.gz
Retain atom 'revert' result (or failure)
When a atom is reverted it can be useful to retain the result of that 'revert' method being called, so that it can be later analyzed (or used for various purposes) so adjust the storage, and actions to enable it to be stored. Change-Id: I38a9a5f3bf7550e924468bb4a86652cb8beb306c
Diffstat (limited to 'taskflow/states.py')
-rw-r--r--taskflow/states.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/taskflow/states.py b/taskflow/states.py
index cbef58c..07e70dd 100644
--- a/taskflow/states.py
+++ b/taskflow/states.py
@@ -41,6 +41,7 @@ SUCCESS = SUCCESS
RUNNING = RUNNING
RETRYING = 'RETRYING'
IGNORE = 'IGNORE'
+REVERT_FAILURE = 'REVERT_FAILURE'
# Atom intentions.
EXECUTE = 'EXECUTE'
@@ -157,20 +158,20 @@ def check_flow_transition(old_state, new_state):
# Task state transitions
-# See: http://docs.openstack.org/developer/taskflow/states.html
+# See: http://docs.openstack.org/developer/taskflow/states.html#task
_ALLOWED_TASK_TRANSITIONS = frozenset((
(PENDING, RUNNING), # run it!
(PENDING, IGNORE), # skip it!
- (RUNNING, SUCCESS), # the task finished successfully
- (RUNNING, FAILURE), # the task failed
+ (RUNNING, SUCCESS), # the task executed successfully
+ (RUNNING, FAILURE), # the task execution failed
- (FAILURE, REVERTING), # task failed, do cleanup now
- (SUCCESS, REVERTING), # some other task failed, do cleanup now
+ (FAILURE, REVERTING), # task execution failed, try reverting...
+ (SUCCESS, REVERTING), # some other task failed, try reverting...
- (REVERTING, REVERTED), # revert done
- (REVERTING, FAILURE), # revert failed
+ (REVERTING, REVERTED), # the task reverted successfully
+ (REVERTING, REVERT_FAILURE), # the task failed reverting (terminal!)
(REVERTED, PENDING), # try again
(IGNORE, PENDING), # try again