mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
import pystemon-feeder configuration from the central configuration file
This commit is contained in:
parent
8102ff009d
commit
83db40104c
1 changed files with 14 additions and 3 deletions
|
@ -24,13 +24,24 @@ import sys
|
|||
import time
|
||||
import redis
|
||||
import base64
|
||||
import os
|
||||
import ConfigParser
|
||||
|
||||
port = "5556"
|
||||
pystemonpath = "/home/pystemon/pystemon/"
|
||||
configfile = os.path.join(os.environ['AIL_BIN'], 'packages/config.cfg')
|
||||
if not os.path.exists(configfile):
|
||||
raise Exception('Unable to find the configuration file. \
|
||||
Did you set environment variables? \
|
||||
Or activate the virtualenv.')
|
||||
|
||||
cfg = ConfigParser.ConfigParser()
|
||||
cfg.read(configfile)
|
||||
|
||||
zmq_url = cfg.get("ZMQ_Global", "address")
|
||||
pystemonpath = cfg.get("Directories", "pystemonpath")
|
||||
|
||||
context = zmq.Context()
|
||||
socket = context.socket(zmq.PUB)
|
||||
socket.bind("tcp://*:%s" % port)
|
||||
socket.bind(zmq_url)
|
||||
|
||||
# check https://github.com/cvandeplas/pystemon/blob/master/pystemon.yaml#L16
|
||||
r = redis.StrictRedis(host='localhost', db=10)
|
||||
|
|
Loading…
Reference in a new issue