Esempio n. 1
0
def launch():
    neighbor_parser = NeighborParser(core.config)
    monitor = NeighborMonitor()

    monitor._myself = neighbor_parser.myself
    monitor._relation_of_neighbor = neighbor_parser.neighbors
    monitor._neighbors_with_relation = neighbor_parser.relations

    core.register_object('NeighborMonitor', monitor)
Esempio n. 2
0
def launch():
    import os, sys
    pox_path = core.config.get('module.pox.pox_path')
    sys.path.append(os.path.abspath(pox_path))

    pox_config = core.config.get('module.pox.pox_command_line')
    myself = core.myself.get_self_controller()
    pox_app = PoxApp(myself, pox_config)
    core.register_object('pox', pox_app)
Esempio n. 3
0
def launch():
    storages_config = core.config.get('module.storage')
    redis = None
    local = None
    for name, parameters in storages_config.items():
        if parameters:
            if redis is None:
                redis = RedisStorage(**parameters)
            core.register_object(name, redis)
        else:
            if local is None:
                local = LocalStorage()
            core.register_object(name, local)
Esempio n. 4
0
def launch():
    logger_parser = LoggerParser()
    logger_generator = logger_parser.parse(core.config)
    core.register_object('logger', logger_generator)