Coverage for manila/wsgi/wsgi.py: 100%
24 statements
« prev ^ index » next coverage.py v7.11.0, created at 2026-02-18 22:19 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2026-02-18 22:19 +0000
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
13"""Manila OS API WSGI application."""
16import sys
18from oslo_config import cfg
19from oslo_log import log as logging
20from oslo_reports import guru_meditation_report as gmr
21from oslo_reports import opts as gmr_opts
22from oslo_service import wsgi
24# Need to register global_opts
25from manila.common import config
26from manila import rpc
27from manila import service
28from manila import version
30CONF = cfg.CONF
31LOG = logging.getLogger(__name__)
34def initialize_application():
35 logging.register_options(CONF)
36 gmr_opts.set_defaults(CONF)
37 CONF(sys.argv[1:], project="manila", version=version.version_string())
38 config.verify_share_protocols()
39 config.set_lib_defaults()
40 logging.setup(CONF, "manila")
41 CONF.log_opt_values(LOG, logging.DEBUG)
43 gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
44 rpc.init(CONF)
45 service.setup_profiler("manila-api", CONF.host)
47 return wsgi.Loader(CONF).load_app(name='osapi_share')