fix: replace redis init with generic ConfigLoader

StrictRedis() replaced by ConfigLoader.get_redis_conn()
This commit is contained in:
osagit 2021-05-07 14:43:25 +02:00 committed by GitHub
parent 22693dca1c
commit abbde8a46a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,7 @@ from lib import Decoded
from module.abstract_module import AbstractModule from module.abstract_module import AbstractModule
from Helper import Process from Helper import Process
from packages import Item from packages import Item
import ConfigLoader
class TimeoutException(Exception): class TimeoutException(Exception):
@ -62,13 +63,9 @@ class Decoder(AbstractModule):
def __init__(self): def __init__(self):
super(Decoder, self).__init__(logger_channel="script:decoder") super(Decoder, self).__init__()
serv_metadata = redis.StrictRedis( serv_metadata = ConfigLoader.ConfigLoader().get_redis_conn("ARDB_Metadata")
host=self.process.config.get("ARDB_Metadata", "host"),
port=self.process.config.getint("ARDB_Metadata", "port"),
db=self.process.config.getint("ARDB_Metadata", "db"),
decode_responses=True)
regex_binary = '[0-1]{40,}' regex_binary = '[0-1]{40,}'
#regex_hex = '(0[xX])?[A-Fa-f0-9]{40,}' #regex_hex = '(0[xX])?[A-Fa-f0-9]{40,}'