From 84cd3c402884654ebc81cec69c7986d45d95e054 Mon Sep 17 00:00:00 2001 From: Sridhar Gaddam Date: Mon, 28 Mar 2016 09:40:47 +0530 Subject: [PATCH] Fix duplicate entries in list_columns while extending the list Closes-Bug: #1561378 Change-Id: I88cfb8f191570a4a34cac54ae872c46b53a3b793 --- neutronclient/neutron/v2_0/agentscheduler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neutronclient/neutron/v2_0/agentscheduler.py b/neutronclient/neutron/v2_0/agentscheduler.py index 2d2b1f7..4476b1d 100644 --- a/neutronclient/neutron/v2_0/agentscheduler.py +++ b/neutronclient/neutron/v2_0/agentscheduler.py @@ -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'