Coverage for manila/cmd/data.py: 92%

24 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2026-02-18 22:19 +0000

1#!/usr/bin/env python3 

2 

3# Copyright 2015, Hitachi Data Systems. 

4# 

5# Licensed under the Apache License, Version 2.0 (the "License"); you may 

6# not use this file except in compliance with the License. You may obtain 

7# a copy of the License at 

8# 

9# http://www.apache.org/licenses/LICENSE-2.0 

10# 

11# Unless required by applicable law or agreed to in writing, software 

12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

14# License for the specific language governing permissions and limitations 

15# under the License. 

16 

17"""Starter script for manila data copy service.""" 

18 

19import eventlet 

20eventlet.monkey_patch() 

21 

22import sys 

23 

24from oslo_config import cfg 

25from oslo_log import log 

26from oslo_reports import guru_meditation_report as gmr 

27from oslo_reports import opts as gmr_opts 

28 

29from manila.common import config # Need to register global_opts # noqa 

30from manila import service 

31from manila import utils 

32from manila import version 

33 

34CONF = cfg.CONF 

35 

36 

37def main(): 

38 log.register_options(CONF) 

39 gmr_opts.set_defaults(CONF) 

40 CONF(sys.argv[1:], project='manila', 

41 version=version.version_string()) 

42 log.setup(CONF, "manila") 

43 utils.monkey_patch() 

44 gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) 

45 server = service.Service.create(binary='manila-data') 

46 service.serve(server) 

47 service.wait() 

48 

49 

50if __name__ == '__main__': 50 ↛ 51line 50 didn't jump to line 51 because the condition on line 50 was never true

51 main()