diff --git a/watcher/applier/manager.py b/watcher/applier/manager.py index 1015733b5..03a2356fe 100644 --- a/watcher/applier/manager.py +++ b/watcher/applier/manager.py @@ -1,5 +1,6 @@ # -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com +# Copyright (c) 2016 Intel Corp # # Authors: Jean-Emile DARTOIS # @@ -17,41 +18,12 @@ # limitations under the License. # -from oslo_config import cfg - from watcher.applier.messaging import trigger from watcher.common import service_manager -CONF = cfg.CONF +from watcher import conf - -# Register options -APPLIER_MANAGER_OPTS = [ - cfg.IntOpt('workers', - default='1', - min=1, - required=True, - help='Number of workers for applier, default value is 1.'), - cfg.StrOpt('conductor_topic', - default='watcher.applier.control', - help='The topic name used for' - 'control events, this topic ' - 'used for rpc call '), - cfg.StrOpt('publisher_id', - default='watcher.applier.api', - help='The identifier used by watcher ' - 'module on the message broker'), - cfg.StrOpt('workflow_engine', - default='taskflow', - required=True, - help='Select the engine to use to execute the workflow') -] - -opt_group = cfg.OptGroup(name='watcher_applier', - title='Options for the Applier messaging' - 'core') -CONF.register_group(opt_group) -CONF.register_opts(APPLIER_MANAGER_OPTS, opt_group) +CONF = conf.CONF class ApplierManager(service_manager.ServiceManager): diff --git a/watcher/applier/rpcapi.py b/watcher/applier/rpcapi.py index cb7a32b23..fdfbacd10 100644 --- a/watcher/applier/rpcapi.py +++ b/watcher/applier/rpcapi.py @@ -1,5 +1,6 @@ # -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com +# Copyright (c) 2016 Intel Corp # # Authors: Jean-Emile DARTOIS # @@ -16,18 +17,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from oslo_config import cfg - -from watcher.applier import manager from watcher.common import exception from watcher.common import service from watcher.common import service_manager from watcher.common import utils +from watcher import conf -CONF = cfg.CONF -CONF.register_group(manager.opt_group) -CONF.register_opts(manager.APPLIER_MANAGER_OPTS, manager.opt_group) +CONF = conf.CONF class ApplierAPI(service.Service): diff --git a/watcher/conf/__init__.py b/watcher/conf/__init__.py index aed92ceb3..846107419 100644 --- a/watcher/conf/__init__.py +++ b/watcher/conf/__init__.py @@ -20,6 +20,7 @@ from oslo_config import cfg from watcher.conf import api +from watcher.conf import applier from watcher.conf import db from watcher.conf import exception from watcher.conf import paths @@ -36,3 +37,4 @@ paths.register_opts(CONF) exception.register_opts(CONF) db.register_opts(CONF) planner.register_opts(CONF) +applier.register_opts(CONF) diff --git a/watcher/conf/_opts.py b/watcher/conf/_opts.py index 246558510..af0d7e9b6 100644 --- a/watcher/conf/_opts.py +++ b/watcher/conf/_opts.py @@ -18,9 +18,9 @@ from keystoneauth1 import loading as ka_loading -from watcher.applier import manager as applier_manager from watcher.common import clients from watcher.conf import api as conf_api +from watcher.conf import applier as conf_applier from watcher.conf import db from watcher.conf import exception from watcher.conf import paths @@ -43,8 +43,8 @@ def list_opts(): ('watcher_decision_engine', (decision_engine_manager.WATCHER_DECISION_ENGINE_OPTS + continuous.WATCHER_CONTINUOUS_OPTS)), - ('watcher_applier', applier_manager.APPLIER_MANAGER_OPTS), ('watcher_planner', conf_planner.WATCHER_PLANNER_OPTS), + ('watcher_applier', conf_applier.APPLIER_MANAGER_OPTS), ('nova_client', clients.NOVA_CLIENT_OPTS), ('glance_client', clients.GLANCE_CLIENT_OPTS), ('cinder_client', clients.CINDER_CLIENT_OPTS), diff --git a/watcher/conf/applier.py b/watcher/conf/applier.py new file mode 100644 index 000000000..70f7d65c0 --- /dev/null +++ b/watcher/conf/applier.py @@ -0,0 +1,53 @@ +# -*- encoding: utf-8 -*- +# Copyright (c) 2016 Intel Corp +# +# Authors: Prudhvi Rao Shedimbi +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from oslo_config import cfg + +watcher_applier = cfg.OptGroup(name='watcher_applier', + title='Options for the Applier messaging' + 'core') + +APPLIER_MANAGER_OPTS = [ + cfg.IntOpt('workers', + default='1', + min=1, + required=True, + help='Number of workers for applier, default value is 1.'), + cfg.StrOpt('conductor_topic', + default='watcher.applier.control', + help='The topic name used for' + 'control events, this topic ' + 'used for rpc call '), + cfg.StrOpt('publisher_id', + default='watcher.applier.api', + help='The identifier used by watcher ' + 'module on the message broker'), + cfg.StrOpt('workflow_engine', + default='taskflow', + required=True, + help='Select the engine to use to execute the workflow') +] + + +def register_opts(conf): + conf.register_group(watcher_applier) + conf.register_opts(APPLIER_MANAGER_OPTS, group=watcher_applier) + + +def list_opts(): + return [('watcher_applier', APPLIER_MANAGER_OPTS)]