diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2015-04-15 15:25:35 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2015-04-15 15:43:08 -0700 |
commit | 0eee98d0d44136e13615fae479680c97e2ca368a (patch) | |
tree | 909c2b0fdc8ea227f915867830060dc072425b48 /tools/state_graph.py | |
parent | a51785ea206521e4f5744dcbbae91fd76cf98c7e (diff) | |
download | taskflow-0eee98d0d44136e13615fae479680c97e2ca368a.tar.gz |
Add job states in docs + states in python
Change-Id: I25af798974dbfe61e144b15056090084aa8ef6dd
Diffstat (limited to 'tools/state_graph.py')
-rwxr-xr-x | tools/state_graph.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/state_graph.py b/tools/state_graph.py index 5ba9da7..7711826 100755 --- a/tools/state_graph.py +++ b/tools/state_graph.py @@ -71,7 +71,7 @@ def map_color(internal_states, state): return 'red' if state == states.REVERTED: return 'darkorange' - if state == states.SUCCESS: + if state in (states.SUCCESS, states.COMPLETE): return 'green' return None @@ -96,6 +96,10 @@ def main(): action='store_true', help="use wbe request transitions", default=False) + parser.add_option("-j", "--jobs", dest="jobs", + action='store_true', + help="use job transitions", + default=False) parser.add_option("-T", "--format", dest="format", help="output in given format", default='svg') @@ -109,9 +113,10 @@ def main(): options.retries, options.tasks, options.wbe_requests, + options.jobs, ] if sum([int(i) for i in types]) > 1: - parser.error("Only one of task/retry/engines/wbe requests" + parser.error("Only one of task/retry/engines/wbe requests/jobs" " may be specified.") internal_states = list() @@ -135,6 +140,10 @@ def main(): source_type = "WBE requests" source = make_machine(protocol.WAITING, list(protocol._ALLOWED_TRANSITIONS), []) + elif options.jobs: + source_type = "Jobs" + source = make_machine(states.UNCLAIMED, + list(states._ALLOWED_JOB_TRANSITIONS), []) else: source_type = "Flow" source = make_machine(states.PENDING, |