Esempio n. 1
0
def launch(app_name,
           port,
           paste_config_file,
           data={},
           host='0.0.0.0',
           backlog=128,
           threads=1000,
           workers=None):
    """Launches a wsgi server based on the passed in paste_config_file.

      Launch provides a easy way to create a paste app from the config
      file and launch it via the service launcher. It takes care of
      all of the plumbing. The only caveat is that the paste_config_file
      must be a file that paste.deploy can find and handle. There is
      a helper method in cfg.py that finds files.

      Example:
        conf_file = CONF.find_file(CONF.api_paste_config)
        launcher = wsgi.launch('myapp', CONF.bind_port, conf_file)
        launcher.wait()

    """
    app = pastedeploy.paste_deploy_app(paste_config_file, app_name, data)
    server = openstack_wsgi.Service(app,
                                    port,
                                    host=host,
                                    backlog=backlog,
                                    threads=threads)
    return service.launch(server, workers)
Esempio n. 2
0
def initialize_trove(config_file):
    from trove.openstack.common import pastedeploy

    cfg.CONF(args=[],
             project='trove',
             default_config_files=[config_file])
    CONF.use_stderr = False
    CONF.log_file = 'rdtest.log'
    logging.setup(None)
    CONF.bind_port = 8779
    CONF.fake_mode_events = 'simulated'
    return pastedeploy.paste_deploy_app(config_file, 'trove', {})
Esempio n. 3
0
def initialize_trove(config_file):
    from trove.openstack.common import pastedeploy

    cfg.CONF(args=[], project="trove", default_config_files=[config_file])
    logging.setup(None)
    topic = CONF.taskmanager_queue
    rpc.init(CONF)

    taskman_service = rpc_service.RpcService(
        None, topic=topic, rpc_api_version=rpc_version.RPC_API_VERSION, manager="trove.taskmanager.manager.Manager"
    )
    taskman_service.start()

    return pastedeploy.paste_deploy_app(config_file, "trove", {})
Esempio n. 4
0
def initialize_trove(config_file):
    from trove.openstack.common import pastedeploy

    cfg.CONF(args=[], project="trove", default_config_files=[config_file])
    logging.setup(None)
    topic = CONF.taskmanager_queue

    from trove.taskmanager import manager

    manager_impl = manager.Manager()
    taskman_service = rpc_service.Service(None, topic=topic, manager=manager_impl)
    taskman_service.start()

    return pastedeploy.paste_deploy_app(config_file, "trove", {})
Esempio n. 5
0
def initialize_trove(config_file):
    from trove.openstack.common import pastedeploy

    cfg.CONF(args=[], project='trove', default_config_files=[config_file])
    logging.setup(None)
    topic = CONF.taskmanager_queue

    from trove.taskmanager import manager
    manager_impl = manager.Manager()
    taskman_service = rpc_service.Service(None,
                                          topic=topic,
                                          manager=manager_impl)
    taskman_service.start()

    return pastedeploy.paste_deploy_app(config_file, 'trove', {})
Esempio n. 6
0
def initialize_trove(config_file):
    from trove.openstack.common import pastedeploy

    cfg.CONF(args=[],
             project='trove',
             default_config_files=[config_file])
    logging.setup(None)
    topic = CONF.taskmanager_queue
    rpc.init(CONF)

    taskman_service = rpc_service.RpcService(
        None, topic=topic, rpc_api_version=rpc_version.RPC_API_VERSION,
        manager='trove.taskmanager.manager.Manager')
    taskman_service.start()

    return pastedeploy.paste_deploy_app(config_file, 'trove', {})
Esempio n. 7
0
def launch(app_name, port, paste_config_file, data={}, host="0.0.0.0", backlog=128, threads=1000, workers=None):
    """Launches a wsgi server based on the passed in paste_config_file.

      Launch provides a easy way to create a paste app from the config
      file and launch it via the service launcher. It takes care of
      all of the plumbing. The only caveat is that the paste_config_file
      must be a file that paste.deploy can find and handle. There is
      a helper method in cfg.py that finds files.

      Example:
        conf_file = CONF.find_file(CONF.api_paste_config)
        launcher = wsgi.launch('myapp', CONF.bind_port, conf_file)
        launcher.wait()

    """
    app = pastedeploy.paste_deploy_app(paste_config_file, app_name, data)
    server = openstack_wsgi.Service(app, port, host=host, backlog=backlog, threads=threads)
    return service.launch(server, workers)