~ubuntu-branches/ubuntu/vivid/ironic/vivid-updates

« back to all changes in this revision

Viewing changes to tools/states_to_dot.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2015-03-30 11:14:57 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20150330111457-kr4ju3guf22m4vbz
Tags: 2015.1~b3-0ubuntu1
* New upstream release.
  + d/control: 
    - Align with upstream dependencies.
    - Add dh-python to build-dependencies.
    - Add psmisc as a dependency. (LP: #1358820)
  + d/p/fix-requirements.patch: Rediffed.
  + d/ironic-conductor.init.in: Fixed typos in LSB headers,
    thanks to JJ Asghar. (LP: #1429962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
 
38
38
def map_color(text):
39
 
    # If the text contains 'error' then we'll return red...
40
 
    if 'error' in text:
 
39
    # If the text contains 'error'/'fail' then we'll return red...
 
40
    if 'error' in text or 'fail' in text:
41
41
        return 'red'
42
42
    else:
43
43
        return None
69
69
    graph_name = "Ironic states"
70
70
    g = pydot.Dot(graph_name=graph_name, rankdir='LR',
71
71
                  nodesep='0.25', overlap='false',
72
 
                  ranksep="0.5", size="11x8.5",
73
 
                  splines='true', ordering='in')
 
72
                  ranksep="0.5", splines='true',
 
73
                  ordering='in')
74
74
    node_attrs = {
75
75
        'fontsize': '11',
76
76
    }
101
101
        g.add_edge(pydot.Edge(nodes[start_state], nodes[end_state],
102
102
                              **edge_attrs))
103
103
 
104
 
    # Make nice start states...
105
 
    starts = [
106
 
        format_state(source.start_state),
107
 
    ]
108
 
    for i, s in enumerate(starts):
109
 
        name = "__start_%s__" % i
110
 
        start = pydot.Node(name, shape="point", width="0.1",
111
 
                           xlabel='start', fontcolor='green', **node_attrs)
112
 
        g.add_node(start)
113
 
        g.add_edge(pydot.Edge(start, nodes[s], style='dotted'))
114
 
 
115
104
    print_header(graph_name)
116
105
    print(g.to_string().strip())
117
106