Coverage for nova/conf/manila.py: 93%

14 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-04-24 11:16 +0000

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

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

3# a copy of the License at 

4# 

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

6# 

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

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

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

10# License for the specific language governing permissions and limitations 

11# under the License. 

12 

13from keystoneauth1 import loading as ks_loading 

14from oslo_config import cfg 

15 

16from nova.conf import utils as confutils 

17 

18DEFAULT_SERVICE_TYPE = 'shared-file-system' 

19 

20manila_group = cfg.OptGroup( 

21 'manila', 

22 title='Manila Options', 

23 help="Configuration options for the share-file-system service") 

24 

25manila_opts = [ 

26 cfg.IntOpt('share_apply_policy_timeout', 

27 default=10, 

28 help=""" 

29Timeout period for share policy application. 

30 

31Maximum duration to await a response from the Manila service for the 

32application of a share policy before experiencing a timeout. 

330 means do not wait (0s). 

34 

35Possible values: 

36 

37* A positive integer or 0 (default value is 10). 

38"""), 

39] 

40 

41 

42def register_opts(conf): 

43 conf.register_group(manila_group) 

44 conf.register_opts(manila_opts, group=manila_group) 

45 ks_loading.register_session_conf_options(conf, manila_group.name) 

46 ks_loading.register_auth_conf_options(conf, manila_group.name) 

47 

48 confutils.register_ksa_opts(conf, manila_group, DEFAULT_SERVICE_TYPE) 

49 

50 

51def list_opts(): 

52 return { 

53 manila_group.name: ( 

54 manila_opts + 

55 ks_loading.get_session_conf_options() + 

56 ks_loading.get_auth_common_conf_options() + 

57 ks_loading.get_auth_plugin_conf_options('v3password')) 

58 }