write local address, port for slave servers in /tmp/pycore.nnnnn/servers file

fixes bug #248
(Boeing r1856)
This commit is contained in:
ahrenholz 2014-07-28 17:49:42 +00:00
parent 3bcbc0ffac
commit 42f176e1ec

View file

@ -832,7 +832,11 @@ class CoreBroker(ConfigurableManager):
if name == "localhost": if name == "localhost":
continue continue
(host, port, sock) = self.servers[name] (host, port, sock) = self.servers[name]
f.write("%s %s %s\n" % (name, host, port)) try:
(lhost, lport) = sock.getsockname()
except:
lhost, lport = None, None
f.write("%s %s %s %s %s\n" % (name, host, port, lhost, lport))
f.close() f.close()
except Exception, e: except Exception, e:
self.session.warn("Error writing server list to the file: %s\n%s" \ self.session.warn("Error writing server list to the file: %s\n%s" \