コード例 #1
0
def main():
    try:
        config.parse_args()
        log.setup('muranoapi')

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

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

        launcher = service.ServiceLauncher()

        app = config.load_paste_app('muranoapi')
        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)
コード例 #3
0
def main():
    CONF.register_cli_opt(command_opt)
    try:
        default_config_files = cfg.find_config_files('murano-api', 'murano')
        CONF(sys.argv[1:],
             project='murano-api',
             prog='murano-manage',
             version=muranoapi.__version__,
             default_config_files=default_config_files)
        logging.setup("murano-api")
    except RuntimeError as e:
        LOG.error("failed to initialize murano-manage: %s" % e)
        sys.exit("ERROR: %s" % e)

    try:
        CONF.command.func()
    except Exception as e:
        tb = traceback.format_exc()
        err_msg = "murano-manage command failed: {0}\n{1}".format(e, tb)
        LOG.error(err_msg)
        sys.exit(err_msg)
コード例 #4
0
def main():
    CONF.register_cli_opt(command_opt)
    try:
        default_config_files = cfg.find_config_files("murano-api", "murano")
        CONF(
            sys.argv[1:],
            project="murano-api",
            prog="murano-manage",
            version=muranoapi.__version__,
            default_config_files=default_config_files,
        )
        logging.setup("murano-api")
    except RuntimeError as e:
        LOG.error("failed to initialize murano-manage: %s" % e)
        sys.exit("ERROR: %s" % e)

    try:
        CONF.command.func()
    except Exception as e:
        tb = traceback.format_exc()
        err_msg = "murano-manage command failed: {0}\n{1}".format(e, tb)
        LOG.error(err_msg)
        sys.exit(err_msg)