superseed config with ENV if available

pull/3/head
ljaqueme 2019-06-11 14:46:46 -06:00
parent c852241b52
commit 54022f6a56
2 changed files with 10 additions and 5 deletions

View File

@ -51,10 +51,12 @@ logger.info("Starting and using FIFO {} from D4 server".format(myqueue))
analyzer_redis_host = os.getenv('D4_ANALYZER_REDIS_HOST', '127.0.0.1')
analyzer_redis_port = int(os.getenv('D4_ANALYZER_REDIS_PORT', 6400))
d4_server = config.get('global', 'd4-server')
r = redis.Redis(host=analyzer_redis_host, port=analyzer_redis_port)
r_d4 = redis.Redis(host=d4_server.split(':')[0], port=d4_server.split(':')[1], db=2)
d4_server, d4_port = config.get('global', 'd4-server').split(':')
host_redis_metadata = os.getenv('D4_REDIS_METADATA_HOST', d4_server)
port_redis_metadata = int(os.getenv('D4_REDIS_METADATA_PORT', d4_port))
r = redis.Redis(host=analyzer_redis_host, port=analyzer_redis_port)
r_d4 = redis.Redis(host=host_redis_metadata, port=port_redis_metadata, db=2)
with open('../etc/records-type.json') as rtypefile:
rtype = json.load(rtypefile)

View File

@ -49,9 +49,12 @@ logger.info("Starting and using FIFO {} from D4 server".format(myqueue))
analyzer_redis_host = os.getenv('D4_ANALYZER_REDIS_HOST', '127.0.0.1')
analyzer_redis_port = int(os.getenv('D4_ANALYZER_REDIS_PORT', 6400))
d4_server = config.get('global', 'd4-server')
d4_server, d4_port = config.get('global', 'd4-server').split(':')
host_redis_metadata = os.getenv('D4_REDIS_METADATA_HOST', d4_server)
port_redis_metadata = int(os.getenv('D4_REDIS_METADATA_PORT', d4_port))
r = redis.Redis(host=analyzer_redis_host, port=analyzer_redis_port)
r_d4 = redis.Redis(host=d4_server.split(':')[0], port=d4_server.split(':')[1], db=2)
r_d4 = redis.Redis(host=host_redis_metadata, port=port_redis_metadata, db=2)
with open('../etc/records-type.json') as rtypefile: