summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-31 18:07:18 +0000
committerGerrit Code Review <review@openstack.org>2019-01-31 18:07:18 +0000
commite6f2f2b6fee6592ab4bc83863bc66eb3b1e30b8f (patch)
treee24ddeac8a6a649575007c7f5a7f2d33b707b0c9
parente20131f177ef0b31c4ec04f08de067cc0b074ef2 (diff)
parent2bc16e78347b56cc0f6dd904e7f5c53d031634a5 (diff)
Merge "Bug Fix: Parses notifier configuration options"
-rw-r--r--monasca_notification/conf/__init__.py8
-rw-r--r--monasca_notification/config.py3
2 files changed, 11 insertions, 0 deletions
diff --git a/monasca_notification/conf/__init__.py b/monasca_notification/conf/__init__.py
index 5dc861d..8928743 100644
--- a/monasca_notification/conf/__init__.py
+++ b/monasca_notification/conf/__init__.py
@@ -54,6 +54,14 @@ def register_opts(conf=None):
54 m.register_opts(conf) 54 m.register_opts(conf)
55 55
56 56
57def register_enabled_plugin_opts(conf=None):
58 if conf is None:
59 conf = CONF
60 for enabled_plugin in conf.notification_types.enabled:
61 ep_module = importutils.import_module(".".join(enabled_plugin.split(".")[:-1]))
62 ep_module.register_opts(conf)
63
64
57def list_opts(): 65def list_opts():
58 opts = collections.defaultdict(list) 66 opts = collections.defaultdict(list)
59 for m in CONF_OPTS: 67 for m in CONF_OPTS:
diff --git a/monasca_notification/config.py b/monasca_notification/config.py
index 64dd997..2654544 100644
--- a/monasca_notification/config.py
+++ b/monasca_notification/config.py
@@ -45,6 +45,9 @@ def parse_args(argv, no_yaml=False):
45 monasca-notification is an engine responsible for 45 monasca-notification is an engine responsible for
46 transforming alarm transitions into proper notifications 46 transforming alarm transitions into proper notifications
47 ''') 47 ''')
48
49 conf.register_enabled_plugin_opts(CONF)
50
48 log.setup(CONF, 51 log.setup(CONF,
49 product_name='monasca-notification', 52 product_name='monasca-notification',
50 version=version.version_string) 53 version=version.version_string)