Coverage for manila/cmd/status.py: 77%

11 statements  

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

1# Copyright (c) 2018 NEC, Corp. 

2# 

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

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

5# a copy of the License at 

6# 

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

8# 

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

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

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

12# License for the specific language governing permissions and limitations 

13# under the License. 

14 

15import sys 

16 

17from oslo_config import cfg 

18from oslo_upgradecheck import common_checks 

19from oslo_upgradecheck import upgradecheck 

20 

21from manila.i18n import _ 

22 

23 

24class Checks(upgradecheck.UpgradeCommands): 

25 

26 """Various upgrade checks should be added as separate methods in this class 

27 

28 and added to _upgrade_checks tuple. 

29 """ 

30 

31 # The format of the check functions is to return an 

32 # oslo_upgradecheck.upgradecheck.Result 

33 # object with the appropriate 

34 # oslo_upgradecheck.upgradecheck.Code and details set. 

35 # If the check hits warnings or failures then those should be stored 

36 # in the returned Result's "details" attribute. The 

37 # summary will be rolled up at the end of the check() method. 

38 _upgrade_checks = ( 

39 (_('Policy File JSON to YAML Migration'), 

40 (common_checks.check_policy_json, {'conf': cfg.CONF})), 

41 ) 

42 

43 

44def main(): 

45 return upgradecheck.main( 

46 cfg.CONF, project='manila', upgrade_command=Checks()) 

47 

48 

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

50 sys.exit(main())