Merge "Update notification config >= mitaka"

This commit is contained in:
Jenkins 2017-08-04 11:44:24 +00:00 committed by Gerrit Code Review
commit 614220d9bf
4 changed files with 23 additions and 5 deletions

View File

@ -789,6 +789,9 @@ class Hooks(object):
def charm_dir():
"""Return the root directory of the current charm"""
d = os.environ.get('JUJU_CHARM_DIR')
if d is not None:
return d
return os.environ.get('CHARM_DIR')

View File

@ -35,10 +35,6 @@ show_image_direct_url = {{ expose_image_locations }}
{% endfor -%}
{% endif -%}
{% if rabbitmq_host or rabbitmq_hosts -%}
notification_driver = messagingv2
{% endif -%}
delayed_delete = False
scrub_time = 43200
scrubber_datadir = /var/lib/glance/scrubber
@ -91,4 +87,6 @@ flavor = keystone
{% include "section-rabbitmq-oslo" %}
{% include "section-oslo-notifications" %}
{% include "parts/section-storage" %}

View File

@ -479,7 +479,21 @@ class GlanceBasicDeployment(OpenStackAmuletDeployment):
'idle_timeout': '3600',
'connection': db_uri
}
expected['DEFAULT']['notification_driver'] = 'messagingv2'
if self._get_openstack_release() >= self.trusty_mitaka:
del expected['DEFAULT']['notification_driver']
connection_uri = (
"rabbit://glance:{}@{}:5672/"
"openstack".format(rel_mq_gl['password'],
rel_mq_gl['hostname'])
)
expected['oslo_messaging_notifications'] = {
'driver': 'messagingv2',
'transport_url': connection_uri
}
else:
expected['DEFAULT']['notification_driver'] = 'messagingv2'
else:
# Juno or earlier
expected['DEFAULT'].update({

View File

@ -789,6 +789,9 @@ class Hooks(object):
def charm_dir():
"""Return the root directory of the current charm"""
d = os.environ.get('JUJU_CHARM_DIR')
if d is not None:
return d
return os.environ.get('CHARM_DIR')