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

10 statements  

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

1# -*- encoding: utf-8 -*- 

2# Copyright (c) 2016 Intel Corp 

3# 

4# Authors: Prudhvi Rao Shedimbi <prudhvi.rao.shedimbi@intel.com> 

5# 

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

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

8# You may obtain a copy of the License at 

9# 

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

11# 

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

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

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

15# implied. 

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

17# limitations under the License. 

18 

19from oslo_config import cfg 

20 

21watcher_applier = cfg.OptGroup(name='watcher_applier', 

22 title='Options for the Applier messaging ' 

23 'core') 

24 

25APPLIER_MANAGER_OPTS = [ 

26 cfg.IntOpt('workers', 

27 default=1, 

28 min=1, 

29 required=True, 

30 help='Number of workers for applier, default value is 1.'), 

31 cfg.StrOpt('conductor_topic', 

32 default='watcher.applier.control', 

33 help='The topic name used for ' 

34 'control events, this topic ' 

35 'used for rpc call '), 

36 cfg.StrOpt('publisher_id', 

37 default='watcher.applier.api', 

38 help='The identifier used by watcher ' 

39 'module on the message broker'), 

40 cfg.StrOpt('workflow_engine', 

41 default='taskflow', 

42 required=True, 

43 help='Select the engine to use to execute the workflow'), 

44] 

45 

46APPLIER_OPTS = [ 

47 cfg.BoolOpt('rollback_when_actionplan_failed', 

48 default=False, 

49 help='If set True, the failed actionplan will rollback ' 

50 'when executing. Default value is False.'), 

51] 

52 

53 

54def register_opts(conf): 

55 conf.register_group(watcher_applier) 

56 conf.register_opts(APPLIER_MANAGER_OPTS, group=watcher_applier) 

57 conf.register_opts(APPLIER_OPTS, group=watcher_applier) 

58 

59 

60def list_opts(): 

61 return [(watcher_applier, APPLIER_MANAGER_OPTS), 

62 (watcher_applier, APPLIER_OPTS)]