Sync charm-helpers and use "rabbit_use_ssl" for ocata

Ensure "rabbit_use_ssl" is specified in the [oslo_messaging_rabbit]
config section instead of "ssl" for Ocata, since "ssl" was not yet
introduced.

Change-Id: I41da24f87cfdc66f6061426913f0d64b7dbb8398
Closes-Bug: #1838696
This commit is contained in:
Corey Bryant 2019-08-01 23:02:47 -04:00 committed by James Page
parent dc5359eee5
commit 3099142117
4 changed files with 25 additions and 16 deletions

View File

@ -127,7 +127,9 @@ def expect_ha():
return len(ha_related_units) > 0 or config('vip') or config('dns-ha')
def generate_ha_relation_data(service, extra_settings=None):
def generate_ha_relation_data(service,
extra_settings=None,
haproxy_enabled=True):
""" Generate relation data for ha relation
Based on configuration options and unit interfaces, generate a json
@ -152,21 +154,18 @@ def generate_ha_relation_data(service, extra_settings=None):
@param extra_settings: Dict of additional resource data
@returns dict: json encoded data for use with relation_set
"""
_haproxy_res = 'res_{}_haproxy'.format(service)
_relation_data = {
'resources': {
_haproxy_res: 'lsb:haproxy',
},
'resource_params': {
_relation_data = {'resources': {}, 'resource_params': {}}
if haproxy_enabled:
_haproxy_res = 'res_{}_haproxy'.format(service)
_relation_data['resources'] = {_haproxy_res: 'lsb:haproxy'}
_relation_data['resource_params'] = {
_haproxy_res: 'op monitor interval="5s"'
},
'init_services': {
_haproxy_res: 'haproxy'
},
'clones': {
}
_relation_data['init_services'] = {_haproxy_res: 'haproxy'}
_relation_data['clones'] = {
'cl_{}_haproxy'.format(service): _haproxy_res
},
}
}
if extra_settings:
for k, v in extra_settings.items():

View File

@ -0,0 +1,10 @@
[oslo_messaging_rabbit]
{% if rabbitmq_ha_queues -%}
rabbit_ha_queues = True
{% endif -%}
{% if rabbit_ssl_port -%}
rabbit_use_ssl = True
{% endif -%}
{% if rabbit_ssl_ca -%}
ssl_ca_file = {{ rabbit_ssl_ca }}
{% endif -%}

View File

@ -78,7 +78,7 @@ bind_port=8000
{% endif %}
workers = {{ workers }}
{% include "section-oslo-messaging-rabbit" %}
{% include "section-oslo-messaging-rabbit-ocata" %}
{% if use_internal_endpoints -%}
[clients]

View File

@ -547,7 +547,7 @@ class HeatBasicDeployment(OpenStackAmuletDeployment):
u.log.debug('rabbitmq:heat relation: {}'.format(rmq_rel))
u.log.debug('percona-cluster:heat relation: {}'.format(mysql_rel))
if self._get_openstack_release() < self.bionic_stein:
if self._get_openstack_release() < self.xenial_queens:
dialect = 'mysql'
else:
dialect = 'mysql+pymysql'