Add type of deployment task to its CSV output
Partial-Bug: #1626433 Change-Id: I3be06a12b389331e3e6605747b25494666c9ac32
This commit is contained in:
parent
1cbef416dc
commit
ee0e867c40
|
@ -77,15 +77,17 @@ class DeploymentHistoryCollectionHandler(base.CollectionHandler):
|
|||
return data
|
||||
|
||||
def get_csv(self, data):
|
||||
keys = ['task_name', 'node_id', 'status', 'time_start', 'time_end']
|
||||
keys = ['task_name',
|
||||
'node_id',
|
||||
'status',
|
||||
'type',
|
||||
'time_start',
|
||||
'time_end']
|
||||
|
||||
res = StringIO()
|
||||
csv_writer = csv.writer(res)
|
||||
csv_writer.writerow(keys)
|
||||
for obj in data:
|
||||
values = []
|
||||
for k in keys:
|
||||
values.append(obj.get(k))
|
||||
csv_writer.writerow(values)
|
||||
csv_writer.writerow([obj.get(k) for k in keys])
|
||||
|
||||
return res.getvalue()
|
||||
|
|
|
@ -300,6 +300,11 @@ class TestDeploymentHistoryHandlers(BaseIntegrationTest):
|
|||
|
||||
self.assertItemsEqual(
|
||||
rows,
|
||||
[['task_name', 'node_id', 'status', 'time_start', 'time_end'],
|
||||
['test2', cluster.nodes[0].uid, 'pending', '', ''],
|
||||
['test1', cluster.nodes[0].uid, 'pending', '', '']])
|
||||
[['task_name',
|
||||
'node_id',
|
||||
'status',
|
||||
'type',
|
||||
'time_start',
|
||||
'time_end'],
|
||||
['test2', cluster.nodes[0].uid, 'pending', 'puppet', '', ''],
|
||||
['test1', cluster.nodes[0].uid, 'pending', 'puppet', '', '']])
|
||||
|
|
Loading…
Reference in New Issue