Fix routings headers

The current implementation that remaps the headers of jobs objects
fails in python3. This change simplify the implementation and fixes
the current failures.

Change-Id: I6620a8aeff2b678ab07ae9a55ef2f1e481bdef5d
This commit is contained in:
Victor Morales 2018-03-26 22:14:26 -07:00
parent fb3b78942c
commit 8f21b50e4c
3 changed files with 5 additions and 7 deletions

View File

@ -80,9 +80,9 @@ class TestListRouting(_TestRoutingCommand):
columns = [
'ID',
'Pod ID',
'Pod',
'Resource Type',
'Top ID'
'Top'
]
def setUp(self):

View File

@ -15,9 +15,7 @@ def prepare_column_headers(columns, remap=None):
remap = remap if remap else {}
new_columns = []
for c in columns:
for old, new in remap.items():
c = c.replace(old, new)
new_columns.append(c.replace('_', ' '))
new_columns.append(remap[c].replace('_', ' '))
return new_columns

View File

@ -137,9 +137,9 @@ class ListRoutings(command.Lister):
data = client.routing.list(self.path)
remap = {'resource_type': 'Resource Type',
'pod': 'Pod',
'pod_id': 'Pod',
'id': 'ID',
'top': 'Top',
'top_id': 'Top',
}
column_headers = utils.prepare_column_headers(self.COLS,
remap)