Commit 5a0b93f0 authored by Federico Sismondi's avatar Federico Sismondi

bugfixes first open RMQ connection, then configure tun/taps else exceptions may rise

parent 27b3394c
......@@ -328,8 +328,11 @@ class OpenTunLinux(object):
def __init__(self, name, rmq_connection, exchange="default",
ipv6_prefix=None, ipv6_host=None,
ipv4_host=None, ipv4_network=None, ipv4_netmask=None):
# log
log.info("create instance")
# RMQ setups
self.connection = rmq_connection
self.producer = self.connection.Producer(serializer='json')
self.exchange = Exchange(exchange, type="topic", durable=False)
self.name = name
self.packet_count = 0
......@@ -373,12 +376,6 @@ class OpenTunLinux(object):
else:
self.tunReadThread = None
# f-interop related part
self.connection = rmq_connection
self.producer = self.connection.Producer(serializer='json')
self.exchange = Exchange(exchange, type="topic", durable=False)
# ======================== public ==========================================
# def close(self):
......@@ -545,8 +542,11 @@ class OpenTunMACOS(object):
def __init__(self, name, rmq_connection, exchange="default",
ipv6_prefix=None, ipv6_host=None,
ipv4_host=None, ipv4_network=None, ipv4_netmask=None):
# log
log.info("create instance")
# RMQ setups
self.connection = rmq_connection
self.producer = self.connection.Producer(serializer='json')
self.exchange = Exchange(exchange, type="topic", durable=False)
self.name = name
self.tun_name = ''
......@@ -591,11 +591,7 @@ class OpenTunMACOS(object):
else:
self.tunReadThread = None
# f-interop related part
self.connection = rmq_connection
self.producer = self.connection.Producer(serializer='json')
self.exchange = Exchange(exchange, type="topic", durable=False)
# ======================== public ==========================================
......
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