diff options
author | Zuul <zuul@review.opendev.org> | 2022-09-16 10:23:44 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-09-16 10:23:44 +0000 |
commit | 3f4847384d3e7c6bcb7f8d13ee62b0f9141c91fc (patch) | |
tree | 00f8f3dbf245291a54c1ba1fe528229d1c105a87 | |
parent | 5189a1e14c4a250942608d0a352cc0f266ab0aaa (diff) | |
parent | a64811671c5a5e35d8614d5ed4e50d44b27333a6 (diff) | |
download | designate-3f4847384d3e7c6bcb7f8d13ee62b0f9141c91fc.tar.gz |
Merge "Check zone_id in notification_handler to avoid UUID format issue." into stable/wallaby
-rw-r--r-- | designate/notification_handler/neutron.py | 6 | ||||
-rw-r--r-- | designate/notification_handler/nova.py | 5 |
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'], |