--- Products/TIDStorage/transaction_transaction.py (revision 46066) +++ Products/TIDStorage/transaction_transaction.py (working copy) @@ -71,25 +71,15 @@ '_commitResources, connected to %s' % ':'.join([str(q) for q in TID_STORAGE_ADDRESS])) -# Borrowed from CMFActivity.ActivityTool.getCurrentNode +from Products.CMFActivity.ActivityTool import getServerAddress def getZopeId(): """ Return current node in form ip:port """ global zope_identifier if zope_identifier is None: - port = '' - from asyncore import socket_map - for k, v in socket_map.items(): - if hasattr(v, 'port') and hasattr(v, 'ip'): - # see Zope/lib/python/App/ApplicationManager.py: def getServers(self) - type = str(getattr(v, '__class__', 'unknown')) - if type == 'ZServer.HTTPServer.zhttp_server': - port = v.port - ip = v.ip - break - assert port != '', 'zhttp_server not started yet' + zope_identifier = getServerAddress() if TID_STORAGE_ADDRESS[0] != '127.0.0.1': - assert ip != '127.0.0.1', 'self address must not be 127.0.0.1 if TIDStorage is remote' - zope_identifier = '%s:%s' %(ip, port) + assert not zope_identifier.startswith('127.0.0.1:'), \ + 'self address must not be 127.0.0.1 if TIDStorage is remote' return zope_identifier def getFilestorageList(resource_list):