Coverage for manila/cmd/api.py: 93%
27 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#!/usr/bin/env python3
3# Copyright 2010 United States Government as represented by the
4# Administrator of the National Aeronautics and Space Administration.
5# All Rights Reserved.
6#
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
19"""Starter script for manila OS API."""
21import eventlet
22eventlet.monkey_patch()
24import sys
26from oslo_config import cfg
27from oslo_log import log
28from oslo_reports import guru_meditation_report as gmr
29from oslo_reports import opts as gmr_opts
31from manila.common import config # Need to register global_opts # noqa
32from manila import service
33from manila import utils
34from manila import version
36CONF = cfg.CONF
39def main():
40 log.register_options(CONF)
41 gmr_opts.set_defaults(CONF)
42 CONF(sys.argv[1:], project='manila',
43 version=version.version_string())
44 config.verify_share_protocols()
45 config.set_lib_defaults()
46 log.setup(CONF, "manila")
47 utils.monkey_patch()
49 gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
50 launcher = service.process_launcher()
51 server = service.WSGIService('osapi_share')
52 launcher.launch_service(server, workers=server.workers or 1)
53 launcher.wait()
56if __name__ == '__main__': 56 ↛ 57line 56 didn't jump to line 57 because the condition on line 56 was never true
57 main()