Example #1
0
def main():
    config.init(app.common_opts, sys.argv[1:])
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning("Wrong worker number, worker = %(workers)s", workers)
        workers = 1

    LOG.info("Admin API on http://%(host)s:%(port)s with %(workers)s", {
        'host': host,
        'port': port,
        'workers': workers
    })

    service = wsgi.Server(CONF, 'Tricircle Admin_API', application, host, port)
    restapp.serve(service, CONF, workers)

    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    restapp.wait()
Example #2
0
def init_application():

    # initialize the config system
    conf_file = _get_config_file()
    config.init(app.common_opts, ['--config-file', conf_file])

    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    # return WSGI app
    return app.setup_app()
Example #3
0
def init_application():

    # initialize the config system
    conf_file = _get_config_file()
    config.init(app.common_opts, ['--config-file', conf_file])

    LOG.info("Configuration:")
    CONF.log_opt_values(LOG, logging.INFO)

    # return WSGI app
    return app.setup_app()
Example #4
0
def main():
    config.init(app.common_opts, sys.argv[1:])
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning(_LW("Wrong worker number, worker = %(workers)s"), workers)
        workers = 1

    LOG.info(_LI("Admin API on http://%(host)s:%(port)s with %(workers)s"),
             {'host': host, 'port': port, 'workers': workers})

    service = wsgi.Server(CONF, 'Tricircle Admin_API', application, host, port)
    restapp.serve(service, CONF, workers)

    LOG.info(_LI("Configuration:"))
    CONF.log_opt_values(LOG, std_logging.INFO)

    restapp.wait()
Example #5
0
def main():
    config.init(sys.argv[1:])
    config.setup_logging()
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning(_LW("Wrong worker number, worker = %(workers)s"), workers)
        workers = 1

    LOG.info(_LI("Server on http://%(host)s:%(port)s with %(workers)s"),
             {'host': host, 'port': port, 'workers': workers})

    serving.run_simple(host, port,
                       application,
                       processes=workers)

    LOG.info(_LI("Configuration:"))
    CONF.log_opt_values(LOG, std_logging.INFO)
Example #6
0
def main():
    config.init(sys.argv[1:])
    config.setup_logging()
    application = app.setup_app()

    host = CONF.bind_host
    port = CONF.bind_port
    workers = CONF.api_workers

    if workers < 1:
        LOG.warning(_LW("Wrong worker number, worker = %(workers)s"), workers)
        workers = 1

    LOG.info(_LI("Server on http://%(host)s:%(port)s with %(workers)s"), {
        'host': host,
        'port': port,
        'workers': workers
    })

    serving.run_simple(host, port, application, processes=workers)

    LOG.info(_LI("Configuration:"))
    CONF.log_opt_values(LOG, std_logging.INFO)