More work on monitless installer
This commit is contained in:
parent
51a95fb989
commit
eefe8910cf
9 changed files with 121 additions and 12 deletions
|
@ -213,7 +213,6 @@ class AirtimeApiClient(object):
|
|||
try:
|
||||
self.config = ConfigObj(config_path)
|
||||
self.config.update(api_config)
|
||||
self.logger.info(json.dumps(self.config))
|
||||
self.services = RequestProvider(self.config)
|
||||
except Exception, e:
|
||||
self.logger.error('Error loading config file: %s', config_path)
|
||||
|
|
|
@ -38,9 +38,9 @@ class AirtimeNotifier(Loggable):
|
|||
durable=True, auto_delete=True)
|
||||
schedule_queue = Queue("media-monitor", exchange=schedule_exchange,
|
||||
key="filesystem")
|
||||
self.connection = BrokerConnection(self.cfg["rabbitmq"]["rabbitmq_host"],
|
||||
self.cfg["rabbitmq"]["rabbitmq_user"], self.cfg["rabbitmq"]["rabbitmq_password"],
|
||||
self.cfg["rabbitmq"]["rabbitmq_vhost"])
|
||||
self.connection = BrokerConnection(self.cfg["rabbitmq"]["host"],
|
||||
self.cfg["rabbitmq"]["user"], self.cfg["rabbitmq"]["password"],
|
||||
self.cfg["rabbitmq"]["vhost"])
|
||||
channel = self.connection.channel()
|
||||
|
||||
self.simple_queue = SimpleQueue(channel, schedule_queue)
|
||||
|
|
|
@ -28,5 +28,5 @@ class MMConfig(object):
|
|||
def last_ran(self):
|
||||
""" Returns the last time media monitor was ran by looking at
|
||||
the time when the file at 'index_path' was modified """
|
||||
return mmp.last_modified(self.cfg['index_path'])
|
||||
return mmp.last_modified(self.cfg['media-monitor']['index_path'])
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class AirtimeInstance(object):
|
|||
|
||||
def touch_file_path(self):
|
||||
""" Get the path of the touch file for every instance """
|
||||
touch_base_path = self.mm_config['index_path']
|
||||
touch_base_path = self.mm_config['media-monitor']['index_path']
|
||||
touch_base_name = basename(touch_base_path)
|
||||
new_base_name = self.name + touch_base_name
|
||||
return join(dirname(touch_base_path), new_base_name)
|
||||
|
|
|
@ -7,7 +7,7 @@ from media.monitor.config import MMConfig
|
|||
def main(global_config, log_config):
|
||||
""" function to run hosted install """
|
||||
mm_config = MMConfig(global_config)
|
||||
log = setup_logger( log_config, mm_config['logpath'] )
|
||||
log = setup_logger( log_config, mm_config['media-monitor']['logpath'] )
|
||||
setup_global(log)
|
||||
launch_instance('hosted_install', '/', global_config)
|
||||
|
||||
|
|
|
@ -36,10 +36,10 @@ class PypoMessageHandler(Thread):
|
|||
try:
|
||||
schedule_exchange = Exchange("airtime-pypo", "direct", durable=True, auto_delete=True)
|
||||
schedule_queue = Queue("pypo-fetch", exchange=schedule_exchange, key="foo")
|
||||
connection = BrokerConnection(self.config["rabbitmq_host"], \
|
||||
self.config["rabbitmq_user"], \
|
||||
self.config["rabbitmq_password"], \
|
||||
self.config["rabbitmq_vhost"])
|
||||
connection = BrokerConnection(self.config["host"], \
|
||||
self.config["user"], \
|
||||
self.config["password"], \
|
||||
self.config["vhost"])
|
||||
|
||||
channel = connection.channel()
|
||||
self.simple_queue = SimpleQueue(channel, schedule_queue)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue