Check zone_id in notification_handler to avoid UUID format issue.

Closes-Bug: #1977826
Change-Id: I81a4883fd48653c3b0d60ac07210fc0de55ac12a
(cherry picked from commit 42dac06e0c)
This commit is contained in:
junbo
2022-06-07 18:47:27 +08:00
committed by Michael Johnson
parent f674574fe7
commit 465cee23d3
2 changed files with 11 additions and 0 deletions

View File

@@ -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'],

View File

@@ -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'],