Load additional config files for oslo.messaging options

Currently ceilometermiddleware supports customizing only the limited
number of oslo.messaging options via proxy-server.conf. However this
does not allow configurations required by some setups. For example when
TLS is enabled in RabbitMQ, the ssl option in RabbitMQ driver but this
option is not configurable now.

This introduces a few new options so that ceilometermiddleware can load
additional config files to look up oslo.messaging options.

Closes-Bug: #1673738
Change-Id: I0cae1a0daec189669e51f89231a3d7932784420e
This commit is contained in:
Takashi Kajinami 2023-12-25 20:22:42 +09:00
parent 0689769ba8
commit 841b04d647
2 changed files with 25 additions and 1 deletions

View File

@ -77,6 +77,7 @@ import queue
import threading
import urllib.parse as urlparse
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
@ -160,10 +161,26 @@ class Swift(object):
self.ignore_projects = self._get_ignore_projects(conf)
extra_config_files = conf.get('extra_config_files')
if extra_config_files is not None:
extra_config_files = list_from_csv(extra_config_files)
extra_config_dirs = conf.get('extra_config_dirs')
if extra_config_dirs is not None:
extra_config_dirs = list_from_csv(extra_config_dirs)
try:
CONF(args=[], default_config_files=extra_config_files,
default_config_dirs=extra_config_dirs)
except cfg.RequiredOptError:
# When authtoken middleware is enabled, CONF.__call__ fails because
# the required [keystone_authtoken] auth_url option is not set.
pass
oslo_messaging.set_transport_defaults(conf.get('control_exchange',
'swift'))
self._notifier = oslo_messaging.Notifier(
oslo_messaging.get_notification_transport(cfg.CONF,
oslo_messaging.get_notification_transport(CONF,
url=conf.get('url')),
publisher_id='ceilometermiddleware',
driver=conf.get('driver', 'messagingv2'),

View File

@ -0,0 +1,7 @@
---
fixes:
- |
The ceilometer middleware now supports loading additional config files to
look up oslo.messaging lbirary options. Set the ``extra_config_files``
parameter or the ``extra_config_dirs`` parameter in the ceilometer
middleware section in the swift proxy server config file.