[Erp5-report] r45839 luke - /erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/

nobody at svn.erp5.org nobody at svn.erp5.org
Thu May 5 09:20:38 CEST 2011


Author: luke
Date: Thu May  5 09:20:37 2011
New Revision: 45839

URL: http://svn.erp5.org?rev=45839&view=rev
Log:
Fetch ip in same way as port.

Modified:
    erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/transaction_transaction.py

Modified: erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/transaction_transaction.py
URL: http://svn.erp5.org/erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/transaction_transaction.py?rev=45839&r1=45838&r2=45839&view=diff
==============================================================================
--- erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/transaction_transaction.py [utf8] (original)
+++ erp5/trunk/utils/Products.TIDStorage/Products/TIDStorage/transaction_transaction.py [utf8] Thu May  5 09:20:37 2011
@@ -78,14 +78,14 @@ def getZopeId():
     port = ''
     from asyncore import socket_map
     for k, v in socket_map.items():
-      if hasattr(v, 'port'):
+      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'
-    ip = socket.gethostbyname(socket.gethostname())
     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)



More information about the Erp5-report mailing list