summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjunbo <junbo4242@gmail.com>2022-06-07 18:47:27 +0800
committerMichael Johnson <johnsomor@gmail.com>2023-05-04 20:49:17 +0000
commit4f2c2a5c0ea68b1716899394f4c1249646807b55 (patch)
tree69d09b4270b9a3c0cd41000ffcd62ba7e9fb3fda
parenta7eb080039a663159f94f91844fdb238e8ec14c6 (diff)
downloaddesignate-stable/victoria.tar.gz
Check zone_id in notification_handler to avoid UUID format issue.stable/victoria
Closes-Bug: #1977826 Change-Id: I81a4883fd48653c3b0d60ac07210fc0de55ac12a (cherry picked from commit 42dac06e0cdef9eccabc7085d0ff9da47563b318) (cherry picked from commit a64811671c5a5e35d8614d5ed4e50d44b27333a6)
-rw-r--r--designate/notification_handler/neutron.py6
-rw-r--r--designate/notification_handler/nova.py5
2 files changed, 11 insertions, 0 deletions
diff --git a/designate/notification_handler/neutron.py b/designate/notification_handler/neutron.py
index 4a816eeb..4b512f6d 100644
--- a/designate/notification_handler/neutron.py
+++ b/designate/notification_handler/neutron.py
@@ -44,6 +44,12 @@ class NeutronFloatingHandler(base.BaseAddressHandler):
self.get_canonical_name(), event_type)
zone_id = cfg.CONF[self.name].zone_id
+
+ if not zone_id:
+ LOG.error('NeutronFloatingHandler: zone_id is None, '
+ 'ignore the event.')
+ return
+
if event_type.startswith('floatingip.delete'):
self._delete(zone_id=zone_id,
resource_id=payload['floatingip_id'],
diff --git a/designate/notification_handler/nova.py b/designate/notification_handler/nova.py
index 7f35ea16..b9a1a973 100644
--- a/designate/notification_handler/nova.py
+++ b/designate/notification_handler/nova.py
@@ -48,6 +48,11 @@ class NovaFixedHandler(BaseAddressHandler):
LOG.debug('NovaFixedHandler received notification - %s', event_type)
zone_id = cfg.CONF[self.name].zone_id
+
+ if not zone_id:
+ LOG.error('NovaFixedHandler: zone_id is None, ignore the event.')
+ return
+
if event_type == 'compute.instance.create.end':
payload['project'] = context.get("project_name", None)
self._create(addresses=payload['fixed_ips'],