Include event id in node request listings
The event id will now be included in the command output of 'request-list' as well as the HTTP endpoint for outstanding node requests. Change-Id: I2475ae879fd0321bac020c84935a5a1d52b8b916
This commit is contained in:
parent
b628195d04
commit
1b28a77284
|
@ -235,14 +235,17 @@ def request_list(zk):
|
|||
("requestor", "Requestor"),
|
||||
("node_types", "Node Types"),
|
||||
("nodes", "Nodes"),
|
||||
("declined_by", "Declined By")])
|
||||
("declined_by", "Declined By"),
|
||||
("event_id", "Event ID"),
|
||||
])
|
||||
objs = []
|
||||
for req in zk.nodeRequestIterator():
|
||||
values = [req.id, req.relative_priority,
|
||||
req.state, req.requestor,
|
||||
req.node_types,
|
||||
req.nodes,
|
||||
req.declined_by]
|
||||
req.declined_by,
|
||||
req.event_id]
|
||||
objs.append(dict(zip(headers_table.keys(),
|
||||
values)))
|
||||
return (objs, headers_table)
|
||||
|
|
|
@ -220,7 +220,8 @@ class TestWebApp(tests.DBTestCase):
|
|||
data = f.read()
|
||||
objs = json.loads(data.decode('utf8'))
|
||||
self.assertDictContainsSubset({'node_types': ['fake-label'],
|
||||
'requestor': 'test_request_list', },
|
||||
'requestor': 'test_request_list',
|
||||
'event_id': req.event_id, },
|
||||
objs[0])
|
||||
|
||||
def test_label_list_json(self):
|
||||
|
|
Loading…
Reference in New Issue