Implemented applier config module

Implemented applier config module

Partially Implements: blueprint centralise-config-opts

Change-Id: I237596b06dc3bee318414346cfa58ae4cb81079b
This commit is contained in:
Prudhvi Rao Shedimbi
2016-11-22 21:09:44 +00:00
committed by David TARDIVEL
parent 80e77a5b81
commit ed21e452e0
5 changed files with 63 additions and 39 deletions

View File

@@ -1,5 +1,6 @@
# -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
# Copyright (c) 2016 Intel Corp
#
# Authors: Jean-Emile DARTOIS <jean-emile.dartois@b-com.com>
#
@@ -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):

View File

@@ -1,5 +1,6 @@
# -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
# Copyright (c) 2016 Intel Corp
#
# Authors: Jean-Emile DARTOIS <jean-emile.dartois@b-com.com>
#
@@ -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):

View File

@@ -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)

View File

@@ -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),

53
watcher/conf/applier.py Normal file
View File

@@ -0,0 +1,53 @@
# -*- encoding: utf-8 -*-
# Copyright (c) 2016 Intel Corp
#
# Authors: Prudhvi Rao Shedimbi <prudhvi.rao.shedimbi@intel.com>
#
# 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)]