Exemplo n.º 1
0
 def setUp(self):
     AsyncTestCase.setUp(self)
     for key in options.keys():
         del options[key]
     define_common_options()
     define_node_options()
     parse_config_file(os.path.join(DIR, 'config_data.py'))
     self.init_storages()
     self.node_oid = str(uuid.uuid1())
     Cluster.instance().init()
Exemplo n.º 2
0
def main():
    define_common_options()
    define_node_options()
    parse_command_line()
    if options.config and os.path.exists(options.config):
        parse_config_file(options.config)
    init_logging()
    node_oid = options.oid or str(uuid.getnode())
    client = NodeAMQPClient(oid=node_oid, 
                            on_msg_callback=on_msg,
                            on_channel_created=channel_created)
    client.connect()
    IOLoop.instance().start()
Exemplo n.º 3
0
def main():
    define_common_options()
    define_manager_options()
    parse_command_line()
    if options.config and os.path.exists(options.config):
        parse_config_file(options.config)
    init_logging()
    log.info("Starting application")
    manager_oid = options.oid or str(uuid.getnode())
    if options.on_test:
        load_fixtures(manager_oid)
    log.info("listen on %s:%s" % (options.http_host, options.http_port))
    ManagerAMQPClient(oid=manager_oid, on_msg_callback=on_mngr_msg).connect()
    get_app().listen(options.http_port)
    IOLoop.instance().start()