Fix duplicate entries in list_columns while extending the list

Closes-Bug: #1561378
Change-Id: I88cfb8f191570a4a34cac54ae872c46b53a3b793
This commit is contained in:
Sridhar Gaddam
2016-03-28 09:40:47 +05:30
parent 214854bf7a
commit 84cd3c4028

View File

@@ -219,7 +219,8 @@ class ListL3AgentsHostingRouter(neutronV20.ListCommand):
# Show the ha_state column only if the server responds with it,
# as some plugins do not support HA routers.
if any('ha_state' in agent for agent in data):
self.list_columns.append('ha_state')
if 'ha_state' not in self.list_columns:
self.list_columns.append('ha_state')
for agent in data:
agent['alive'] = ":-)" if agent['alive'] else 'xxx'