Bug Fix: Parses notifier configuration options
Successfully parses configuration options for enabled notifiers. IMPORTANT: This requires the built-in notifiers be "enabled" in the configuration. This patch is compliant with `https://review.openstack.org/#/c/435136/` that in summary makes every notifier pluggable as apposed distinguished built-in and pluggable notifiers. Change-Id: I818212344268de5e90e72c5493a8632476ba254b Story: #2003794 Task: #26507
This commit is contained in:
parent
1d680f1739
commit
2bc16e7834
@ -54,6 +54,14 @@ def register_opts(conf=None):
|
||||
m.register_opts(conf)
|
||||
|
||||
|
||||
def register_enabled_plugin_opts(conf=None):
|
||||
if conf is None:
|
||||
conf = CONF
|
||||
for enabled_plugin in conf.notification_types.enabled:
|
||||
ep_module = importutils.import_module(".".join(enabled_plugin.split(".")[:-1]))
|
||||
ep_module.register_opts(conf)
|
||||
|
||||
|
||||
def list_opts():
|
||||
opts = collections.defaultdict(list)
|
||||
for m in CONF_OPTS:
|
||||
|
@ -45,6 +45,9 @@ def parse_args(argv, no_yaml=False):
|
||||
monasca-notification is an engine responsible for
|
||||
transforming alarm transitions into proper notifications
|
||||
''')
|
||||
|
||||
conf.register_enabled_plugin_opts(CONF)
|
||||
|
||||
log.setup(CONF,
|
||||
product_name='monasca-notification',
|
||||
version=version.version_string)
|
||||
|
Loading…
x
Reference in New Issue
Block a user