コード例 #1
0
ファイル: test_runner.py プロジェクト: vryzhenkin/murano
def main():
    test_runner = MuranoTestRunner()
    try:
        if test_runner.args.config_file:
            default_config_files = [test_runner.args.config_file]
        else:
            default_config_files = cfg.find_config_files('murano')
            if not default_config_files:
                murano_conf = os.path.join(os.path.dirname(__file__),
                                           os.pardir, os.pardir, 'etc',
                                           'murano', 'murano.conf')
                if os.path.exists(murano_conf):
                    default_config_files = [murano_conf]
        sys.argv = [sys.argv[0]]
        config.parse_args(default_config_files=default_config_files)
        CONF.set_default('use_stderr', False)
        logging.setup(CONF, 'murano')
    except RuntimeError as e:
        LOG.exception("Failed to initialize murano-test-runner: %s", e)
        sys.exit("ERROR: %s" % e)

    try:
        exit_code = test_runner.run_tests()
        sys.exit(exit_code)
    except Exception as e:
        if isinstance(e, dsl_exception.MuranoPlException):
            tb = e.format()
        else:
            tb = traceback.format_exc()
        err_msg = "Command failed: {0}\n{1}".format(e, tb)
        LOG.error(err_msg)
        sys.exit(err_msg)
コード例 #2
0
def main():
    try:
        config.parse_args()
        config.set_middleware_defaults()
        request_statistics.init_stats()
        policy.init()

        logging.setup(CONF, 'murano')
        workers = CONF.murano.api_workers
        if not workers:
            workers = processutils.get_worker_count()
        launcher = service.launch(CONF,
                                  server.ApiService(),
                                  workers=workers,
                                  restart_method='mutate')

        app = app_loader.load_paste_app('murano')
        port, host = (CONF.bind_port, CONF.bind_host)
        launcher.launch_service(wsgi.Service(app, port, host))
        launcher.launch_service(server.NotificationService())
        launcher.launch_service(stats.StatsCollectingService())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #3
0
ファイル: api.py プロジェクト: hybrid-murano/murano-mitaka
def main():
    try:
        hybrid.patch()
        config.parse_args()
        config.set_middleware_defaults()
        request_statistics.init_stats()
        policy.init()

        logging.setup(CONF, 'murano')
        launcher = service.ServiceLauncher(CONF)

        app = app_loader.load_paste_app('murano')
        port, host = (CONF.bind_port, CONF.bind_host)

        launcher.launch_service(wsgi.Service(app, port, host))

        launcher.launch_service(server.ApiService())
        launcher.launch_service(server.NotificationService())
        launcher.launch_service(stats.StatsCollectingService())
        launcher.launch_service(scheduler.SchedulerService())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #4
0
ファイル: test_runner.py プロジェクト: GovardhanSN/murano
def main():
    test_runner = MuranoTestRunner()
    try:
        if test_runner.args.config_file:
            default_config_files = [test_runner.args.config_file]
        else:
            default_config_files = cfg.find_config_files('murano')
            if not default_config_files:
                murano_conf = os.path.join(os.path.dirname(__file__),
                                           os.pardir,
                                           os.pardir,
                                           'etc', 'murano',
                                           'murano.conf')
                if os.path.exists(murano_conf):
                    default_config_files = [murano_conf]
        sys.argv = [sys.argv[0]]
        config.parse_args(default_config_files=default_config_files)
        logging.setup(CONF, 'murano')
    except RuntimeError as e:
        LOG.exception(_LE("Failed to initialize murano-test-runner: %s") % e)
        sys.exit("ERROR: %s" % e)

    try:
        exit_code = test_runner.run_tests()
        sys.exit(exit_code)
    except Exception as e:
        tb = traceback.format_exc()
        err_msg = _LE("Command failed: {0}\n{1}").format(e, tb)
        LOG.error(err_msg)
        sys.exit(err_msg)
コード例 #5
0
def main():
    parser = get_parser()
    args = parser.parse_args()

    try:
        if args.config_file:
            default_config_files = [args.config_file]
        else:
            default_config_files = cfg.find_config_files('murano')
            if not default_config_files:
                murano_conf = os.path.join(os.path.dirname(__file__),
                                           os.pardir,
                                           os.pardir,
                                           'etc', 'murano',
                                           'murano.conf')
                if os.path.exists(murano_conf):
                    default_config_files = [murano_conf]
        sys.argv = [sys.argv[0]]
        config.parse_args(default_config_files=default_config_files)
    except RuntimeError as e:
        LOG.exception(_LE("Failed to initialize murano-test-runner: %s") % e)
        sys.exit("ERROR: %s" % e)

    try:
        exit_code = run_tests(args)
        sys.exit(exit_code)
    except Exception as e:
        tb = traceback.format_exc()
        err_msg = _LE("Command failed: {0}\n{1}").format(e, tb)
        LOG.error(err_msg)
        sys.exit(err_msg)
コード例 #6
0
ファイル: engine.py プロジェクト: glovethu/murano
def main():
    try:
        config.parse_args()

        launcher = service.ServiceLauncher(CONF)
        launcher.launch_service(engine.get_rpc_service())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #7
0
ファイル: engine.py プロジェクト: olivierlemasle/murano
def main():
    try:
        config.parse_args()

        logging.setup(CONF, 'murano')
        launcher = service.ServiceLauncher(CONF)
        launcher.launch_service(engine.EngineService())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #8
0
def main():
    try:
        config.parse_args()

        logging.setup(CONF, 'murano')
        launcher = service.ServiceLauncher(CONF)
        launcher.launch_service(engine.get_rpc_service())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #9
0
ファイル: engine.py プロジェクト: AleptNamrata/murano
def main():
    try:
        config.parse_args()

        logging.setup(CONF, 'murano')
        workers = CONF.engine.workers
        if not workers:
            workers = processutils.get_worker_count()
        launcher = service.launch(CONF,
                                  engine.EngineService(), workers=workers)
        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #10
0
def main():
    try:
        config.parse_args()

        logging.setup(CONF, 'murano')
        workers = CONF.engine.engine_workers
        if not workers:
            workers = processutils.get_worker_count()
        launcher = service.launch(CONF,
                                  engine.EngineService(),
                                  workers=workers)
        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #11
0
ファイル: api.py プロジェクト: ativelkov/murano-api
def main():
    try:
        config.parse_args()
        log.setup('murano')
        request_statistics.init_stats()
        policy.init()

        launcher = service.ServiceLauncher()

        app = config.load_paste_app('murano')
        port, host = (config.CONF.bind_port, config.CONF.bind_host)

        launcher.launch_service(wsgi.Service(app, port, host))
        launcher.launch_service(server.get_rpc_service())
        launcher.launch_service(server.get_notification_service())
        launcher.launch_service(stats.StatsCollectingService())

        launcher.wait()
    except RuntimeError, e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #12
0
ファイル: api.py プロジェクト: sergmelikyan/murano
def main():
    try:
        config.parse_args()
        log.setup('murano')
        request_statistics.init_stats()
        policy.init()

        launcher = service.ServiceLauncher()

        app = config.load_paste_app('murano')
        port, host = (config.CONF.bind_port, config.CONF.bind_host)

        launcher.launch_service(wsgi.Service(app, port, host))
        launcher.launch_service(server.get_rpc_service())
        launcher.launch_service(server.get_notification_service())
        launcher.launch_service(stats.StatsCollectingService())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #13
0
ファイル: cfapi.py プロジェクト: Magic-Mirror/murano
def main():
    try:
        config.parse_args()
        logging.setup(CONF, "murano-cfapi")
        request_statistics.init_stats()
        policy.init()

        launcher = service.ServiceLauncher(CONF)

        cfapp = app_loader.load_paste_app("cloudfoundry")
        cfport, cfhost = (config.CONF.cfapi.bind_port, config.CONF.cfapi.bind_host)

        launcher.launch_service(wsgi.Service(cfapp, cfport, cfhost))

        launcher.launch_service(server.get_rpc_service())
        launcher.launch_service(server.get_notification_service())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #14
0
def main():
    try:
        config.parse_args()
        logging.setup(CONF, 'murano-cfapi')
        request_statistics.init_stats()
        policy.init()

        launcher = service.ServiceLauncher(CONF)

        cfapp = app_loader.load_paste_app('cloudfoundry')
        cfport, cfhost = (config.CONF.cfapi.bind_port,
                          config.CONF.cfapi.bind_host)

        launcher.launch_service(wsgi.Service(cfapp, cfport, cfhost))

        launcher.launch_service(server.get_rpc_service())
        launcher.launch_service(server.get_notification_service())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)
コード例 #15
0
ファイル: api.py プロジェクト: toby82/murano
def main():
    try:
        config.parse_args()
        config.set_middleware_defaults()
        request_statistics.init_stats()
        policy.init()

        logging.setup(CONF, 'murano')
        launcher = service.ServiceLauncher(CONF)

        app = app_loader.load_paste_app('murano')
        port, host = (CONF.bind_port, CONF.bind_host)

        launcher.launch_service(wsgi.Service(app, port, host))

        launcher.launch_service(server.ApiService())
        launcher.launch_service(server.NotificationService())
        launcher.launch_service(stats.StatsCollectingService())

        launcher.wait()
    except RuntimeError as e:
        sys.stderr.write("ERROR: %s\n" % e)
        sys.exit(1)