Fix /usr/bin/ipa dupled server list

Fix get_url_list() so that the configured master server is there
just once. This fix lets /usr/bin/ipa try connecting to all IPA
masters just once and not print confusing server list with
dupled master.

https://fedorahosted.org/freeipa/ticket/1817
This commit is contained in:
Martin Kosek 2011-09-19 18:37:27 +02:00
parent 9ccd979f02
commit ffd760c100

View File

@ -325,7 +325,15 @@ class xmlclient(Connectible):
servers = list(set(servers)) servers = list(set(servers))
# the list/set conversion won't preserve order so stick in the # the list/set conversion won't preserve order so stick in the
# local config file version here. # local config file version here.
servers.insert(0, self.env.xmlrpc_uri) cfg_server = self.env.xmlrpc_uri
if cfg_server in servers:
# make sure the configured master server is there just once and
# it is the first one
servers.remove(cfg_server)
servers.insert(0, cfg_server)
else:
servers.insert(0, cfg_server)
return servers return servers
def create_connection(self, ccache=None, verbose=False, fallback=True): def create_connection(self, ccache=None, verbose=False, fallback=True):