Commit bde2570c authored by Federico Sismondi's avatar Federico Sismondi

doc++ on OS requirements, patch for ensuring message is delivered on AMQP connection errors

parent 0804682a
...@@ -11,6 +11,15 @@ kind on interface with the implementation under test (IUT), it will ...@@ -11,6 +11,15 @@ kind on interface with the implementation under test (IUT), it will
enable the creation of a private network between all devices in the enable the creation of a private network between all devices in the
session. session.
OS requirements
---------------
This component has been tested with MacOs and Ubuntu (v15.04 or +).
Windows OS (yet) are not supported.
For Ubuntu 17.04 or +, you need to install iproute2:
`apt-get -y -qq install iproute2`
Installation Installation
------------ ------------
......
...@@ -70,15 +70,23 @@ class TunConsumer(BaseConsumer): ...@@ -70,15 +70,23 @@ class TunConsumer(BaseConsumer):
def _publish_agent_tun_started_message(self): def _publish_agent_tun_started_message(self):
assert self.tun is not None assert self.tun is not None
def errback(exc, interval):
self.log.error('Error: %r', exc, exc_info=1)
self.log.info('Retry in %s seconds.', interval)
# get config from tun # get config from tun
conf_params = self.tun.get_tun_configuration() conf_params = self.tun.get_tun_configuration()
conf_params.update({'name': self.name}) conf_params.update({'name': self.name})
# publish message in event bus # publish message in event bus
msg = messages.MsgAgentTunStarted(**conf_params) msg = messages.MsgAgentTunStarted(**conf_params)
logging.info('Publishing %s' % repr(msg)) self.log.debug('Publishing %s' % repr(msg))
producer = Producer(self.connection, serializer='json') producer = Producer(self.connection, serializer='json')
producer.publish( publish = self.connection.ensure(producer, producer.publish, errback=errback, max_retries=3)
publish(
body=msg.to_dict(), body=msg.to_dict(),
exchange=self.exchange, exchange=self.exchange,
routing_key='fromAgent.{0}.ip.tun.started'.format(self.name) routing_key='fromAgent.{0}.ip.tun.started'.format(self.name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment