示例#1
0
文件: base.py 项目: lvdongbing/bilean
    def setUp(self):
        super(BileanTestCase, self).setUp()
        self.setup_logging()
        self.useFixture(fixtures.MonkeyPatch(
            'bilean.common.exception._FATAL_EXCEPTION_FORMAT_ERRORS',
            True))

        messaging.setup("fake://", optional=True)
        self.addCleanup(messaging.cleanup)

        utils.setup_dummy_db()
        self.addCleanup(utils.reset_dummy_db)
示例#2
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='bilean', prog='bilean-scheduler')
    logging.setup(cfg.CONF, 'bilean-scheduler')
    logging.set_defaults()
    messaging.setup()

    from bilean.scheduler import service as scheduler

    srv = scheduler.SchedulerService(cfg.CONF.host, consts.SCHEDULER_TOPIC)
    launcher = service.launch(cfg.CONF, srv)
    launcher.wait()
示例#3
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='bilean', prog='bilean-notification')
    logging.setup(cfg.CONF, 'bilean-notification')
    logging.set_defaults()
    messaging.setup()

    from bilean.notification import notification

    srv = notification.NotificationService()
    launcher = service.launch(cfg.CONF, srv)
    launcher.wait()
示例#4
0
    def setUp(self):
        super(BileanTestCase, self).setUp()
        self.setup_logging()
        self.useFixture(
            fixtures.MonkeyPatch(
                'bilean.common.exception._FATAL_EXCEPTION_FORMAT_ERRORS',
                True))

        messaging.setup("fake://", optional=True)
        self.addCleanup(messaging.cleanup)

        utils.setup_dummy_db()
        self.addCleanup(utils.reset_dummy_db)
示例#5
0
def main():
    logging.register_options(cfg.CONF)
    cfg.CONF(project='bilean', prog='bilean-engine')
    logging.setup(cfg.CONF, 'bilean-engine')
    logging.set_defaults()
    messaging.setup()

    from bilean.engine import service as engine

    srv = engine.EngineService(cfg.CONF.host, consts.ENGINE_TOPIC)
    launcher = service.launch(cfg.CONF, srv,
                              workers=cfg.CONF.num_engine_workers)
    launcher.wait()
示例#6
0
文件: api.py 项目: openstack/bilean
def main():
    try:
        logging.register_options(cfg.CONF)
        cfg.CONF(project='bilean', prog='bilean-api',
                 version=version.version_info.version_string())
        logging.setup(cfg.CONF, 'bilean-api')
        messaging.setup()

        app = config.load_paste_app()

        port = cfg.CONF.bilean_api.bind_port
        host = cfg.CONF.bilean_api.bind_host
        LOG.info(_LI('Starting Bilean ReST API on %(host)s:%(port)s'),
                 {'host': host, 'port': port})
        server = wsgi.Server('bilean-api', cfg.CONF.bilean_api)
        server.start(app, default_port=port)
        systemd.notify_once()
        server.wait()
    except RuntimeError as ex:
        sys.exit("ERROR: %s" % six.text_type(ex))