Commit 064e742c authored by Federico Sismondi's avatar Federico Sismondi

refact API stricture, nw packet dumper , rmq log hanlder are part of the newly...

refact API stricture, nw packet dumper , rmq log hanlder are part of the newly created event_bus_utils package
parent 22729e9e
Pipeline #2645 failed with stage
in 0 seconds
......@@ -8,7 +8,7 @@ import traceback
try:
from messages import *
except:
from .messages import *
from messages import *
VERSION = '0.0.10'
AMQP_EXCHANGE = 'amq.topic'
......
......@@ -2,22 +2,21 @@
# -*- coding: utf-8 -*-
import os
import json
import pika
import signal
import shutil
import logging
import signal
from datetime import datetime
import pika
# use this as main and also lib:
try:
from messages import *
from pure_pcapy import Dumper, Pkthdr, DLT_RAW, DLT_IEEE802_15_4_NOFCS
from rmq_handler import RabbitMQHandler, JsonFormatter
from event_bus_utils.rmq_handler import RabbitMQHandler, JsonFormatter
except:
from .messages import *
from .pure_pcapy import Dumper, Pkthdr, DLT_RAW, DLT_IEEE802_15_4_NOFCS
from .rmq_handler import RabbitMQHandler, JsonFormatter
from messages import *
from pure_pcapy import Dumper, Pkthdr, DLT_RAW, DLT_IEEE802_15_4_NOFCS
from event_bus_utils.rmq_handler import RabbitMQHandler, JsonFormatter
try:
# For Python 3.0 and later
......
......@@ -1427,10 +1427,10 @@ def main():
try:
env_url = str(os.environ['AMQP_URL'])
if 'heartbeat_interval' not in env_url:
if 'heartbeat' not in env_url:
url = '%s?%s&%s&%s&%s&%s' % (
env_url,
"heartbeat_interval=600",
"heartbeat=600",
"blocked_connection_timeout=300",
"retry_delay=1",
"socket_timeout=1",
......
......@@ -63,6 +63,7 @@ DLT_IEEE802_15_4_NOFCS = 230
logger = logging.getLogger()
class PcapError(Exception):
""" General Pcap module exception class """
pass
......
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