Support dict values for the notification parameter
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: Ia9e973dd5bdedd7970e65f5b00377a3032173256
diff --git a/neutron/files/liberty/neutron-server.conf.Debian b/neutron/files/liberty/neutron-server.conf.Debian
index 4d15921..80a4559 100644
--- a/neutron/files/liberty/neutron-server.conf.Debian
+++ b/neutron/files/liberty/neutron-server.conf.Debian
@@ -570,7 +570,12 @@
# Driver or drivers to handle sending notifications. (multi
# valued)
# notification_driver=
-{%- if server.notification %}
+{%- 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 = neutron.openstack.common.notifier.rpc_notifier
{%- endif %}
# AMQP topic used for OpenStack notifications. (list value)
diff --git a/neutron/files/mitaka/neutron-generic.conf.Debian b/neutron/files/mitaka/neutron-generic.conf.Debian
index 4dc3003..d746ac2 100644
--- a/neutron/files/mitaka/neutron-generic.conf.Debian
+++ b/neutron/files/mitaka/neutron-generic.conf.Debian
@@ -1181,7 +1181,12 @@
# messaging, messagingv2, routing, log, test, noop (multi valued)
# Deprecated group/name - [DEFAULT]/notification_driver
#driver =
-{%- if neutron.get('notification', False) %}
+{%- if neutron.notification is mapping %}
+driver = {{ neutron.notification.get('driver', 'messagingv2') }}
+{%- if neutron.notification.topics is defined %}
+topics = {{ neutron.notification.topics }}
+{%- endif %}
+{%- elif neutron.get('notification', False) %}
driver = messagingv2
{%- endif %}
diff --git a/neutron/files/mitaka/neutron-server.conf.Debian b/neutron/files/mitaka/neutron-server.conf.Debian
index b587cba..eae3a94 100644
--- a/neutron/files/mitaka/neutron-server.conf.Debian
+++ b/neutron/files/mitaka/neutron-server.conf.Debian
@@ -1241,7 +1241,12 @@
# 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 %}
# A URL representing the messaging driver to use for notifications. If not set,