Verify aim_epg exists before proceeding

While updating port properties, it is possible that the
network has already been removed.

Change-Id: Icbc702fe04869cd40c44bc8eb8ba80982fc629db
This commit is contained in:
ajgoyal 2019-08-29 14:11:23 -07:00
parent 71fba717e0
commit 73ddfc4dcf
1 changed files with 3 additions and 0 deletions

View File

@ -4314,6 +4314,9 @@ class ApicMechanismDriver(api_plus.MechanismDriver,
mapping = self._get_network_mapping(session, port['network_id'])
epg = self._get_network_epg(mapping)
aim_epg = self.aim.get(aim_ctx, epg)
# Verify that the aim_epg is present before proceeding further.
if not aim_epg:
return
host_id = port[portbindings.HOST_ID]
aim_hd_mappings = (self.aim.find(aim_ctx,
aim_infra.HostDomainMappingV2,