From 3cab85a1c249bec3f21153fc0ad7e7a654a0179d Mon Sep 17 00:00:00 2001 From: Luka Peschke Date: Tue, 24 Sep 2019 14:53:43 +0200 Subject: [PATCH] Register keystone auth options with keystoneauth1 helper functions This replaces manual config option registration with "keystoneauth1.loading.register_auth_conf_options" in the monasca collector. Registering the config options manually causes the "auth_section" option to be unavailable when using the source fetcher. Change-Id: Iddc590ff2e321392bb0d78f603a96f5b37bda31c Story: 2006606 Task: 36774 --- cloudkitty/collector/monasca.py | 7 +++---- cloudkitty/common/config.py | 1 - ...eauth-functions-monasca-collector-1a539fc8c23e9dbc.yaml | 6 ++++++ 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/register-keystone-opts-with-keystoneauth-functions-monasca-collector-1a539fc8c23e9dbc.yaml diff --git a/cloudkitty/collector/monasca.py b/cloudkitty/collector/monasca.py index d58dab78..9bf25faa 100644 --- a/cloudkitty/collector/monasca.py +++ b/cloudkitty/collector/monasca.py @@ -34,9 +34,6 @@ LOG = logging.getLogger(__name__) MONASCA_API_VERSION = '2_0' COLLECTOR_MONASCA_OPTS = 'collector_monasca' -keystone_opts = ks_loading.get_auth_common_conf_options() + \ - ks_loading.get_session_conf_options() - collector_monasca_opts = [ cfg.StrOpt( 'interface', @@ -51,8 +48,10 @@ collector_monasca_opts = [ ] CONF = cfg.CONF -CONF.register_opts(keystone_opts, COLLECTOR_MONASCA_OPTS) + CONF.register_opts(collector_monasca_opts, COLLECTOR_MONASCA_OPTS) +ks_loading.register_auth_conf_options(CONF, COLLECTOR_MONASCA_OPTS) +ks_loading.register_session_conf_options(CONF, COLLECTOR_MONASCA_OPTS) METRICS_CONF = ck_utils.load_conf(CONF.collect.metrics_conf) diff --git a/cloudkitty/common/config.py b/cloudkitty/common/config.py index 6d8ff546..ec5a3525 100644 --- a/cloudkitty/common/config.py +++ b/cloudkitty/common/config.py @@ -45,7 +45,6 @@ _opts = [ cloudkitty.collector.gnocchi.keystone_opts, cloudkitty.collector.gnocchi.collector_gnocchi_opts))), ('collector_monasca', list(itertools.chain( - cloudkitty.collector.monasca.keystone_opts, cloudkitty.collector.monasca.collector_monasca_opts))), ('collector_prometheus', list(itertools.chain( cloudkitty.collector.prometheus.collector_prometheus_opts))), diff --git a/releasenotes/notes/register-keystone-opts-with-keystoneauth-functions-monasca-collector-1a539fc8c23e9dbc.yaml b/releasenotes/notes/register-keystone-opts-with-keystoneauth-functions-monasca-collector-1a539fc8c23e9dbc.yaml new file mode 100644 index 00000000..0aaa7ce8 --- /dev/null +++ b/releasenotes/notes/register-keystone-opts-with-keystoneauth-functions-monasca-collector-1a539fc8c23e9dbc.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Keystone authentication options are now registered with ``keystoneauth1`` in + the monasca collector helper functions, which allows to use the + ``auth_section`` option even when using the ``source`` fetcher.