From d17e6b2b95ddbaa16b58f9ed5c271e182b7b9073 Mon Sep 17 00:00:00 2001 From: James Page Date: Thu, 13 Jul 2017 16:57:14 +0100 Subject: [PATCH] Update notification config >= mitaka Use oslo_messaging_notifications for mitaka or later releases including setting the transport_url to the value provided by the AMQP context. This removes use of deprecated configuration options for ceilometer notifications. Change-Id: Ia76bd5070a1a419d35327a10c560b16e3c78320e --- .../charmhelpers/contrib/charmsupport/nrpe.py | 2 +- .../templates/section-oslo-notifications | 8 ++++++ templates/mitaka/neutron.conf | 25 +++++++++++++++++++ tests/basic_deployment.py | 13 ++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 hooks/charmhelpers/contrib/openstack/templates/section-oslo-notifications create mode 100644 templates/mitaka/neutron.conf diff --git a/hooks/charmhelpers/contrib/charmsupport/nrpe.py b/hooks/charmhelpers/contrib/charmsupport/nrpe.py index 424b7f76..80d574dc 100644 --- a/hooks/charmhelpers/contrib/charmsupport/nrpe.py +++ b/hooks/charmhelpers/contrib/charmsupport/nrpe.py @@ -125,7 +125,7 @@ class CheckException(Exception): class Check(object): - shortname_re = '[A-Za-z0-9-_]+$' + shortname_re = '[A-Za-z0-9-_.]+$' service_template = (""" #--------------------------------------------------- # This file is Juju managed diff --git a/hooks/charmhelpers/contrib/openstack/templates/section-oslo-notifications b/hooks/charmhelpers/contrib/openstack/templates/section-oslo-notifications new file mode 100644 index 00000000..5dccd4bb --- /dev/null +++ b/hooks/charmhelpers/contrib/openstack/templates/section-oslo-notifications @@ -0,0 +1,8 @@ +{% if transport_url -%} +[oslo_messaging_notifications] +driver = messagingv2 +transport_url = {{ transport_url }} +{% if notification_topics -%} +topics = {{ notification_topics }} +{% endif -%} +{% endif -%} diff --git a/templates/mitaka/neutron.conf b/templates/mitaka/neutron.conf new file mode 100644 index 00000000..e774f888 --- /dev/null +++ b/templates/mitaka/neutron.conf @@ -0,0 +1,25 @@ +# kilo +############################################################################### +# [ WARNING ] +# Configuration file maintained by Juju. Local changes may be overwritten. +############################################################################### +[DEFAULT] +verbose = {{ verbose }} +debug = {{ debug }} +core_plugin = {{ core_plugin }} +{% if network_device_mtu -%} +network_device_mtu = {{ network_device_mtu }} +{% endif -%} +api_workers = {{ workers }} + +{% include "section-zeromq" %} + +[agent] +root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf + +{% include "section-rabbitmq-oslo" %} + +{% include "section-oslo-notifications" %} + +[oslo_concurrency] +lock_path = /var/lock/neutron diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index fdf0deab..e4d297be 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -550,6 +550,19 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment): } } + if self._get_openstack_release() >= self.trusty_mitaka: + del expected['DEFAULT']['control_exchange'] + del expected['DEFAULT']['notification_driver'] + connection_uri = ( + "rabbit://neutron:{}@{}:5672/" + "openstack".format(rmq_ng_rel['password'], + rmq_ng_rel['hostname']) + ) + expected['oslo_messaging_notifications'] = { + 'driver': 'messagingv2', + 'transport_url': connection_uri + } + if self._get_openstack_release() >= self.trusty_kilo: # Kilo or later expected['oslo_messaging_rabbit'] = {