From 6b9b02c11201d1afd960af0196eff56c6f81ffef Mon Sep 17 00:00:00 2001 From: Dmitrii Shcherbakov Date: Thu, 8 Feb 2018 17:06:50 +0300 Subject: [PATCH] emit notifications on notifications_designate Change I804a34fb044090010ecfd2560594cc1f55e9bd21, commit hash b89de21d47dc9114d20456452cd867041bcd83c5 dropped notifications_designate completely to solve a problem described in pad.lv/1738100, however, to make this change backwards compatible notifications_designate should be used in addition to "notifications" topic used by default. This way designate will continue to receive notifications on notifications_designate from nova, and ceilometer will get notifications using the "notifications" topic. Change-Id: I245f5b263994c204a5e521dad542ed83952f54b8 Related-Bug: #1710831 Related-Bug: #1738100 --- hooks/nova_compute_context.py | 3 +++ unit_tests/test_nova_compute_contexts.py | 1 + 2 files changed, 4 insertions(+) diff --git a/hooks/nova_compute_context.py b/hooks/nova_compute_context.py index 05b2cfd9..593e93a7 100644 --- a/hooks/nova_compute_context.py +++ b/hooks/nova_compute_context.py @@ -598,6 +598,9 @@ class DesignateContext(context.OSContextGenerator): if related_units(rid): ctxt['enable_designate'] = True if ctxt['enable_designate']: + notification_topics = ['notifications', + 'notifications_designate'] + ctxt['notification_topics'] = ','.join(notification_topics) ctxt['notify_on_state_change'] = 'vm_and_task_state' return ctxt diff --git a/unit_tests/test_nova_compute_contexts.py b/unit_tests/test_nova_compute_contexts.py index 57ff5b4b..02895c19 100644 --- a/unit_tests/test_nova_compute_contexts.py +++ b/unit_tests/test_nova_compute_contexts.py @@ -517,6 +517,7 @@ class DesignateContextTests(CharmTestCase): self.related_units.return_value = 'designate/0' self.assertEqual(designatectxt(), { 'enable_designate': True, + 'notification_topics': 'notifications,notifications_designate', 'notify_on_state_change': 'vm_and_task_state', })