Coverage for manila/cmd/scheduler.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 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"); you may 

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

9# 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, WITHOUT 

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

16# License for the specific language governing permissions and limitations 

17# under the License. 

18 

19"""Starter script for manila Scheduler.""" 

20 

21import eventlet 

22eventlet.monkey_patch() 

23 

24import sys 

25 

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 

30 

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

32from manila import service 

33from manila import utils 

34from manila import version 

35 

36CONF = cfg.CONF 

37 

38 

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 log.setup(CONF, "manila") 

45 utils.monkey_patch() 

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

47 server = service.Service.create(binary='manila-scheduler', 

48 coordination=True) 

49 service.serve(server) 

50 service.wait() 

51 

52 

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

54 main()