Coverage for watcher/conf/collector.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.8.2, created at 2025-06-17 12:22 +0000

1# Copyright (c) 2017 NEC Corporation 

2# 

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

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

5# You may obtain 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, 

11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 

12# implied. 

13# See the License for the specific language governing permissions and 

14# limitations under the License. 

15 

16from oslo_config import cfg 

17 

18 

19collector = cfg.OptGroup(name='collector', 

20 title='Defines the parameters of ' 

21 'the module model collectors') 

22 

23COLLECTOR_OPTS = [ 

24 cfg.ListOpt('collector_plugins', 

25 default=['compute'], 

26 help=""" 

27The cluster data model plugin names. 

28 

29Supported in-tree collectors include: 

30 

31* ``compute`` - data model collector for nova 

32* ``storage`` - data model collector for cinder 

33* ``baremetal`` - data model collector for ironic 

34 

35Custom data model collector plugins can be defined with the 

36``watcher_cluster_data_model_collectors`` extension point. 

37"""), 

38 cfg.IntOpt('api_call_retries', 

39 default=10, 

40 help="Number of retries before giving up on external service " 

41 "calls."), 

42 cfg.IntOpt('api_query_timeout', 

43 default=1, 

44 help="Time before retry after failed call to external service.") 

45] 

46 

47 

48def register_opts(conf): 

49 conf.register_group(collector) 

50 conf.register_opts(COLLECTOR_OPTS, 

51 group=collector) 

52 

53 

54def list_opts(): 

55 return [(collector, COLLECTOR_OPTS)]