Bug 1713712

Summary: [Bug] Designate pool manager not honoring also_notifies in pools.yml - patch available
Product: Red Hat OpenStack Reporter: Cristian Muresanu <cmuresan>
Component: openstack-designateAssignee: Michael Johnson <michjohn>
Status: CLOSED ERRATA QA Contact: Ofer Blaut <oblaut>
Severity: medium Docs Contact:
Priority: low    
Version: 13.0 (Queens)CC: cgoncalves, cmuresan, ltomasbo, mgarciac, michjohn, njohnston, scohen
Target Milestone: zstreamKeywords: Triaged, ZStream
Target Release: 13.0 (Queens)   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: openstack-designate-6.0.1-5.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-28 18:26:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
designate_worker_bug_589409.patch none

Description Cristian Muresanu 2019-05-24 14:39:33 UTC
Description of problem:

We are trying to make use of the also_notifies attribute used in the Designate pools.yml in our OSP 13 deployment to signal an external DNS service of changes within zones that Designate manages. 
It was identified that this feature wasn't working in a stock deployment and after some research found that it was a bug that got fixed in the upstream community https://bugs.launchpad.net/designate/+bug/1785769
A patch has been created against python-designate-6.0.1-3.el7ost.noarch and verify that the fix in the upstream bug solved the problem. 
We'd like this patch backported to OSP13.

The following patch is verified that works against python-designate-6.0.1-3.el7ost.noarch (based on the upstream bug fix)


designate_worker_bug_589409.patch
~~~
--- a/designate/worker/service.py	2019-05-21 19:48:31.919780738 +0000
+++ b/designate/worker/service.py	2019-05-21 19:51:25.894249273 +0000
@@ -34,6 +34,12 @@
 LOG = logging.getLogger(__name__)
 CONF = cfg.CONF

+class AlsoNotifyTask(object):
+    """
+    Placeholder to define options for also_notify targets
+    """
+    pass
+

 class Service(service.RPCService, service.Service):
     RPC_API_VERSION = '1.0'
@@ -121,10 +127,20 @@

     def _do_zone_action(self, context, zone):
         pool = self.get_pool(zone.pool_id)
-        task = zonetasks.ZoneAction(
+        all_tasks = []
+        all_tasks.append(zonetasks.ZoneAction(
             self.executor, context, pool, zone, zone.action
-        )
-        return self.executor.run(task)
+        ))
+
+        # Send a NOTIFY to each also-notifies
+        for also_notify in pool.also_notifies:
+            notify_target = AlsoNotifyTask()
+            notify_target.options = {'host': also_notify.host,
+                                     'port': also_notify.port}
+            all_tasks.append(zonetasks.SendNotify(self.executor,
+                                                  zone,
+                                                  notify_target))
+        return self.executor.run(all_tasks)

     def create_zone(self, context, zone):
         """
~~~

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Cristian Muresanu 2019-05-24 14:42:32 UTC
Created attachment 1572924 [details]
designate_worker_bug_589409.patch

Comment 16 errata-xmlrpc 2020-10-28 18:26:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 13 bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4387