Replaced REST listener address to listen on 0.0.0.0 so we do not need to

reassing listener on case of ip change of VM.
This commit is contained in:
Adolfo Gómez García 2016-10-27 08:05:01 +02:00
parent a07f1d5b24
commit 1f6279cd46
2 changed files with 5 additions and 4 deletions

View File

@ -34,7 +34,7 @@ from __future__ import unicode_literals
# On centos, old six release does not includes byte2int, nor six.PY2
import six
VERSION = '2.0.0'
VERSION = '2.1.0'
__title__ = 'udsactor'
__version__ = VERSION

View File

@ -210,9 +210,9 @@ class CommonService(object):
self.knownIps = dict(((v.mac, v.ip) for v in netInfo))
# And notify new listening address to broker
address = (self.knownIps[self.api.mac], random.randrange(43900, 44000))
# address = (self.knownIps[self.api.mac], random.randrange(43900, 44000))
# And new listening address
self.httpServer.restart(address)
# self.httpServer.restart(address)
# sends notification
self.api.notifyComm(self.httpServer.getServerUrl())
@ -252,7 +252,8 @@ class CommonService(object):
self.ipc.start()
if self.api.mac in self.knownIps:
address = (self.knownIps[self.api.mac], random.randrange(43900, 44000))
# address = (self.knownIps[self.api.mac], random.randrange(43900, 44000))
address = ('0.0.0.0', random.randrange(43900, 44000))
logger.info('Starting REST listener at {}'.format(address))
self.httpServer = httpserver.HTTPServerThread(address, self)
self.httpServer.start()