Пример #1
0
def init_application():
    # Initialize the oslo configuration library and logging
    service.prepare_service(sys.argv)
    profiler.setup('zun-api', CONF.host)

    LOG.debug("Configuration:")
    CONF.log_opt_values(LOG, log.DEBUG)

    return app.load_app()
Пример #2
0
def init_application():
    # Initialize the oslo configuration library and logging
    service.prepare_service(sys.argv)
    profiler.setup('zun-api', CONF.host)

    LOG.debug("Configuration:")
    CONF.log_opt_values(LOG, log.DEBUG)

    return app.load_app()
Пример #3
0
def init_application():
    # NOTE(hberaud): Call reset to ensure the ConfigOpts object doesn't
    # already contain registered options if the app is reloaded.
    CONF.reset()
    # Initialize the oslo configuration library and logging
    service.prepare_service(sys.argv)
    profiler.setup('zun-api', CONF.host)

    LOG.debug("Configuration:")
    CONF.log_opt_values(LOG, log.DEBUG)

    return app.load_app()
Пример #4
0
    def __init__(self, name, use_ssl=False):
        """Initialize, but do not start the WSGI server.

        :param name: The name of the WSGI server given to the loader.
        :param use_ssl: Wraps the socket in an SSL context if True.
        :returns: None
        """
        self.name = name
        self.app = app.load_app()
        self.workers = (CONF.api.workers or processutils.get_worker_count())
        if self.workers and self.workers < 1:
            raise exception.ConfigInvalid(
                _("api_workers value of %d is invalid, "
                  "must be greater than 0.") % self.workers)

        self.server = wsgi.Server(CONF, name, self.app,
                                  host=CONF.api.host_ip,
                                  port=CONF.api.port,
                                  use_ssl=use_ssl)
Пример #5
0
    def __init__(self, name, use_ssl=False):
        """Initialize, but do not start the WSGI server.

        :param name: The name of the WSGI server given to the loader.
        :param use_ssl: Wraps the socket in an SSL context if True.
        :returns: None
        """
        self.name = name
        self.app = app.load_app()
        self.workers = (CONF.api.workers or processutils.get_worker_count())
        if self.workers and self.workers < 1:
            raise exception.ConfigInvalid(
                _("api_workers value of %d is invalid, "
                  "must be greater than 0.") % self.workers)

        self.server = wsgi.Server(CONF,
                                  name,
                                  self.app,
                                  host=CONF.api.host_ip,
                                  port=CONF.api.port,
                                  use_ssl=use_ssl)
Пример #6
0
 def make_app(self, paste_file):
     file_name = self.get_path(paste_file)
     cfg.CONF.set_override("api_paste_config", file_name, group="api")
     return webtest.TestApp(app.load_app())
Пример #7
0
 def make_app(self, paste_file):
     file_name = self.get_path(paste_file)
     cfg.CONF.set_override("api_paste_config", file_name, group="api")
     return webtest.TestApp(app.load_app())