Support new style RMQ conf files

The rabbitmq-server charm now uses INI style .conf files for
releases that support the new style of configuration.

Update SSL checks to look for this file first and then fallback
to the older .config filename if not found
This commit is contained in:
James Page
2021-11-15 10:57:35 +00:00
parent 9f2ca38de9
commit f877ae0a36

View File

@@ -354,9 +354,15 @@ def is_ssl_enabled_on_unit(unit, port=None):
host = unit.public_address
unit_name = unit.entity_id
conf_file = '/etc/rabbitmq/rabbitmq.config'
conf_file = '/etc/rabbitmq/rabbitmq.conf'
conf_contents = str(generic_utils.get_file_contents(unit,
conf_file))
# Fallback to old style configuration file for
# older RMQ releases if .conf is empty/not found
if not conf_contents:
conf_file = '/etc/rabbitmq/rabbitmq.config'
conf_contents = str(generic_utils.get_file_contents(unit,
conf_file))
# Checks
conf_ssl = 'ssl' in conf_contents
conf_port = str(port) in conf_contents