Commit c140c6c4 authored by Jameson Rollins's avatar Jameson Rollins

system: fix bug in state data fetching

closes #50
parent d4e98747
......@@ -729,7 +729,7 @@ class GuardSystem(object):
elif isinstance(key, int):
for state, index in self._graph.nodes(data='index'):
if index == key:
return state, data
return state, self._graph.nodes[state]
raise KeyError("%s is not a state index" % key)
else:
......
......@@ -12,9 +12,9 @@ guardutil print TEST0 \
cat <<EOF >EXPECTED
ifo: T1
name: TEST0
CA prefix:
module:
MOD_PATH/TEST0.py
CA prefix:
nominal state: NONE
initial request: NONE
states (*=requestable):
......@@ -32,11 +32,11 @@ guardutil print TEST1 \
cat <<EOF >EXPECTED
ifo: T1
name: TEST1
CA prefix: TEST-
module:
MOD_PATH/TEST1.py
usercode:
MOD_PATH/TEST0.py
CA prefix: TEST-
nominal state: D
initial request: A
states (*=requestable):
......@@ -55,9 +55,9 @@ guardutil print TEST_indices \
cat <<EOF >EXPECTED
ifo: T1
name: TEST_indices
CA prefix:
module:
MOD_PATH/TEST_indices.py
CA prefix:
nominal state: NONE
initial request: NONE
states (*=requestable):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment