Commit 5da44892 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Support both '/' and space everywhere as separator for master list.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1942 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e2146ce6
......@@ -50,9 +50,8 @@ class ConfigurationManager(object):
masters = self.__get('masters')
if not masters:
return []
# load master node list except itself
return util.parseMasterList(masters, except_node=self.getBind(),
separator='/')
# lod master node list except itself
return util.parseMasterList(masters, except_node=self.getBind())
def getBind(self):
""" Get the address to bind to """
......
......@@ -68,12 +68,14 @@ def resolve(hostname):
return address_list[0]
def parseMasterList(masters, except_node=None, separator=' '):
def parseMasterList(masters, except_node=None):
if not masters:
return []
# load master node list
master_node_list = []
for node in masters.split(separator):
# XXX: support '/' and ' ' as separator
masters = masters.replace('/', ' ')
for node in masters.split(' '):
ip_address, port = node.split(':')
ip_address = resolve(ip_address)
address = (ip_address, int(port))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment