示例#1
0
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        log.setup('glance')

        glance_store.register_opts(config.CONF)
        glance_store.create_stores(config.CONF)
        glance_store.verify_default_store()

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   notifier.messaging, {},
                                                   notifier.get_transport(),
                                                   "glance", "api",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server()
        server.start(config.load_paste_app('glance-api'), default_port=9292)
        systemd.notify_once()
        server.wait()
    except exception.WorkerCreationFailure as e:
        fail(2, e)
    except RuntimeError as e:
        fail(1, e)
示例#2
0
def main():
    try:
        config.parse_args()
        config.set_config_defaults()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'searchlight')
        utils.register_plugin_opts()

        # Fail fast if service policy files aren't found
        service_policies.check_policy_files()

        if CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   notifier.messaging, {},
                                                   notifier.get_transport(),
                                                   "searchlight", "search",
                                                   CONF.api.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server(workers=CONF.api.workers)
        server.start(config.load_paste_app('searchlight'),
                     default_port=9393)
        server.wait()
    except KNOWN_EXCEPTIONS as e:
        fail(e)
示例#3
0
def main():
    try:
        config.parse_args()
        config.set_config_defaults()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'glance')
        notifier.set_defaults()

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   oslo_messaging, {},
                                                   notifier.get_transport(),
                                                   "glance", "registry",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
            osprofiler.web.enable(cfg.CONF.profiler.hmac_keys)
        else:
            osprofiler.web.disable()

        server = wsgi.Server()
        server.start(config.load_paste_app('glance-registry'),
                     default_port=9191)
        server.wait()
    except RuntimeError as e:
        sys.exit("ERROR: %s" % encodeutils.exception_to_unicode(e))
示例#4
0
文件: api.py 项目: BetaRabbit/glance
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        log.setup('glance')

        glance_store.register_opts(config.CONF)
        glance_store.create_stores(config.CONF)
        glance_store.verify_default_store()

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   notifier.messaging, {},
                                                   notifier.get_transport(),
                                                   "glance", "api",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server()
        server.start(config.load_paste_app('glance-api'), default_port=9292)
        server.wait()
    except exception.WorkerCreationFailure as e:
        fail(2, e)
    except RuntimeError as e:
        fail(1, e)
示例#5
0
def main():
    try:
        config.parse_args()
        config.set_config_defaults()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'xmonitor')
        notifier.set_defaults()

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   oslo_messaging, {},
                                                   notifier.get_transport(),
                                                   "xmonitor", "registry",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
            osprofiler.web.enable(cfg.CONF.profiler.hmac_keys)
        else:
            osprofiler.web.disable()

        server = wsgi.Server()
        server.start(config.load_paste_app('xmonitor-registry'),
                     default_port=9191)
        server.wait()
    except RuntimeError as e:
        sys.exit("ERROR: %s" % encodeutils.exception_to_unicode(e))
示例#6
0
def configure_wsgi():
    config.parse_args()
    config.set_config_defaults()
    logging.setup(CONF, 'searchlight')
    utils.register_plugin_opts()

    # Fail fast if service policy files aren't found
    service_policies.check_policy_files()

    if CONF.profiler.enabled:
        _notifier = osprofiler.notifier.create("Messaging", notifier.messaging,
                                               {}, notifier.get_transport(),
                                               "searchlight", "search",
                                               CONF.api.bind_host)
        osprofiler.notifier.set(_notifier)
    else:
        osprofiler.web.disable()
示例#7
0
文件: api.py 项目: sjmc7/searchlight
def configure_wsgi():
    config.parse_args()
    config.set_config_defaults()
    logging.setup(CONF, 'searchlight')
    utils.register_plugin_opts()

    # Fail fast if service policy files aren't found
    service_policies.check_policy_files()

    if CONF.profiler.enabled:
        _notifier = osprofiler.notifier.create("Messaging",
                                               notifier.messaging, {},
                                               notifier.get_transport(),
                                               "searchlight", "search",
                                               CONF.api.bind_host)
        osprofiler.notifier.set(_notifier)
    else:
        osprofiler.web.disable()
示例#8
0
文件: api.py 项目: froyobin/xmonitor
def main():
    config.parse_args()
    config.set_config_defaults()
    wsgi.set_eventlet_hub()
    logging.setup(CONF, 'xmonitor')
    notifier.set_defaults()
    if cfg.CONF.profiler.enabled:
        _notifier = osprofiler.notifier.create("Messaging", oslo_messaging, {},
                                               notifier.get_transport(),
                                               "xmonitor", "api",
                                               cfg.CONF.bind_host)
        osprofiler.notifier.set(_notifier)
        osprofiler.web.enable(cfg.CONF.profiler.hmac_keys)
    else:
        osprofiler.web.disable()

    server = wsgi.Server(initialize_glance_store=True)
    server.start(config.load_paste_app('xmonitor-api'), default_port=9696)
    server.wait()
示例#9
0
文件: api.py 项目: froyobin/xmonitor
def main():
    config.parse_args()
    config.set_config_defaults()
    wsgi.set_eventlet_hub()
    logging.setup(CONF, 'xmonitor')
    notifier.set_defaults()
    if cfg.CONF.profiler.enabled:
        _notifier = osprofiler.notifier.create("Messaging",
                                               oslo_messaging, {},
                                               notifier.get_transport(),
                                               "xmonitor", "api",
                                               cfg.CONF.bind_host)
        osprofiler.notifier.set(_notifier)
        osprofiler.web.enable(cfg.CONF.profiler.hmac_keys)
    else:
        osprofiler.web.disable()

    server = wsgi.Server(initialize_glance_store=True)
    server.start(config.load_paste_app('xmonitor-api'), default_port=9696)
    server.wait()
示例#10
0
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        log.setup("glance")

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create(
                "Messaging", notifier.messaging, {}, notifier.get_transport(), "glance", "registry", cfg.CONF.bind_host
            )
            osprofiler.notifier.set(_notifier)

        else:
            osprofiler.web.disable()

        server = wsgi.Server()
        server.start(config.load_paste_app("glance-registry"), default_port=9191)
        server.wait()
    except RuntimeError as e:
        sys.exit("ERROR: %s" % utils.exception_to_str(e))
示例#11
0
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'glare')

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   oslo_messaging, {},
                                                   notifier.get_transport(),
                                                   "glance", "artifacts",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server(initialize_glance_store=True)
        server.start(config.load_paste_app('glare-api'), default_port=9494)
        server.wait()
    except KNOWN_EXCEPTIONS as e:
        fail(e)
示例#12
0
文件: api.py 项目: vefimova/glance
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'glance')

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   notifier.messaging, {},
                                                   notifier.get_transport(),
                                                   "glance", "api",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server(initialize_glance_store=True)
        server.start(config.load_paste_app('glance-api'), default_port=9292)
        server.wait()
    except KNOWN_EXCEPTIONS as e:
        fail(e)
示例#13
0
文件: api.py 项目: UTSA-ICS/sios
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'sios')

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   notifier.messaging, {},
                                                   notifier.get_transport(),
                                                   "sios", "api",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server()
        server.start(config.load_paste_app('sios-api'), default_port=9292)
        server.wait()
    except KNOWN_EXCEPTIONS as e:
        fail(e)
示例#14
0
def configure_wsgi():
    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn't
    # already contain registered options if the app is reloaded.
    CONF.reset()
    config.parse_args()
    config.set_config_defaults()
    logging.setup(CONF, 'searchlight')
    gmr.TextGuruMeditation.setup_autorun(version)
    utils.register_plugin_opts()

    # Fail fast if service policy files aren't found
    service_policies.check_policy_files()

    if CONF.profiler.enabled:
        _notifier = osprofiler.notifier.create("Messaging", notifier.messaging,
                                               {}, notifier.get_transport(),
                                               "searchlight", "search",
                                               CONF.api.bind_host)
        osprofiler.notifier.set(_notifier)
    else:
        osprofiler.web.disable()
示例#15
0
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'rebac')

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   notifier.messaging, {},
                                                   notifier.get_transport(),
                                                   "rebac", "api",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server()
	print("Starting web server....")
        server.start(config.load_paste_app('rebac-api'), default_port=9292)
        server.wait()
    except KNOWN_EXCEPTIONS as e:
        fail(e)
示例#16
0
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'daisy')

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   notifier.messaging, {},
                                                   notifier.get_transport(),
                                                   "daisy", "api",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server()
        server.start(config.load_paste_app('daisy-api'), default_port=9292)
        systemd.notify_once()
        server.wait()
    except Exception as e:
        fail(e)
示例#17
0
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        log.setup('glance')

        if cfg.CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   notifier.messaging, {},
                                                   notifier.get_transport(),
                                                   "glance", "registry",
                                                   cfg.CONF.bind_host)
            osprofiler.notifier.set(_notifier)

        else:
            osprofiler.web.disable()

        server = wsgi.Server()
        server.start(config.load_paste_app('glance-registry'),
                     default_port=9191)
        server.wait()
    except RuntimeError as e:
        sys.exit("ERROR: %s" % e)
示例#18
0
文件: api.py 项目: neha08/searchlight
def main():
    try:
        config.parse_args()
        wsgi.set_eventlet_hub()
        logging.setup(CONF, 'searchlight')
        utils.register_plugin_opts()

        if CONF.profiler.enabled:
            _notifier = osprofiler.notifier.create("Messaging",
                                                   notifier.messaging, {},
                                                   notifier.get_transport(),
                                                   "searchlight", "search",
                                                   CONF.api.bind_host)
            osprofiler.notifier.set(_notifier)
        else:
            osprofiler.web.disable()

        server = wsgi.Server(workers=CONF.api.workers)
        server.start(config.load_paste_app('searchlight'),
                     default_port=9393)
        server.wait()
    except KNOWN_EXCEPTIONS as e:
        fail(e)