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()
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()
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)
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())