Coverage for manila/cmd/share.py: 94%
30 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 2013 NetApp
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
18"""Starter script for manila Share."""
20import eventlet
21eventlet.monkey_patch()
23import sys
25from oslo_config import cfg
26from oslo_log import log
27from oslo_reports import guru_meditation_report as gmr
28from oslo_reports import opts as gmr_opts
30from manila.common import config # Need to register global_opts # noqa
31from manila import service
32from manila import utils
33from manila import version
35CONF = cfg.CONF
38def main():
39 log.register_options(CONF)
40 gmr_opts.set_defaults(CONF)
41 CONF(sys.argv[1:], project='manila',
42 version=version.version_string())
43 log.setup(CONF, "manila")
44 utils.monkey_patch()
45 gmr.TextGuruMeditation.setup_autorun(version, conf=CONF)
46 launcher = service.process_launcher()
47 if CONF.enabled_share_backends:
48 for backend in CONF.enabled_share_backends:
49 host = "%s@%s" % (CONF.host, backend)
50 server = service.Service.create(host=host,
51 service_name=backend,
52 binary='manila-share',
53 coordination=True)
54 launcher.launch_service(server)
55 else:
56 server = service.Service.create(binary='manila-share')
57 launcher.launch_service(server)
58 launcher.wait()
61if __name__ == '__main__': 61 ↛ 62line 61 didn't jump to line 62 because the condition on line 61 was never true
62 main()