Merge "Fix duplicate entries in list_columns while extending the list"

This commit is contained in:
Jenkins
2016-05-09 23:40:29 +00:00
committed by Gerrit Code Review

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'