Support dict values for server.notification

This change allows to configure the notification topic(s) and messaging
driver. It preserves backward-compatibility when the 'notification'
parameter is a boolean value instead of a dict.

Change-Id: I5cc00df1f9483d24c2b3656c7a7722918af94ffd
This commit is contained in:
Simon Pasquier 2016-12-01 14:25:59 +01:00
parent 205ef80360
commit d42f40b2fb
2 changed files with 13 additions and 2 deletions

View File

@ -233,10 +233,16 @@ log_dir = /var/log/keystone
# The Drivers(s) to handle sending notifications. Possible values are
# messaging, messagingv2, routing, log, test, noop (multi valued)
{%- if server.notification %}
#notification_driver=
{%- if server.notification is mapping %}
notification_driver = {{ server.notification.get('driver', 'messagingv2') }}
{%- if server.notification.topics is defined %}
notification_topics = {{ server.notification.topics }}
{%- endif %}
{%- elif server.notification %}
notification_driver=messagingv2
{%- endif %}
# AMQP topic used for OpenStack notifications. (list value)
# Deprecated group/name - [rpc_notifier2]/topics
#notification_topics = notifications

View File

@ -1475,7 +1475,12 @@ servers = ['{{ server.cache.host }}:{{ server.cache.port }}']
# messaging, messagingv2, routing, log, test, noop (multi valued)
# Deprecated group/name - [DEFAULT]/notification_driver
#driver =
{%- if server.notification %}
{%- if server.notification is mapping %}
driver = {{ server.notification.get('driver', 'messagingv2') }}
{%- if server.notification.topics is defined %}
topics = {{ server.notification.topics }}
{%- endif %}
{%- elif server.notification %}
driver=messagingv2
{%- endif %}