[Neo-report] r1942 gregory - in /trunk/neo: config.py util.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Mar 16 17:07:52 CET 2010
Author: gregory
Date: Tue Mar 16 17:07:46 2010
New Revision: 1942
Log:
Support both '/' and space everywhere as separator for master list.
Modified:
trunk/neo/config.py
trunk/neo/util.py
Modified: trunk/neo/config.py
==============================================================================
--- trunk/neo/config.py [iso-8859-1] (original)
+++ trunk/neo/config.py [iso-8859-1] Tue Mar 16 17:07:46 2010
@@ -50,9 +50,8 @@
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 """
Modified: trunk/neo/util.py
==============================================================================
--- trunk/neo/util.py [iso-8859-1] (original)
+++ trunk/neo/util.py [iso-8859-1] Tue Mar 16 17:07:46 2010
@@ -68,12 +68,14 @@
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))
More information about the Neo-report
mailing list