Skip port if it's on the OVN MAC Net

Skip ports for which the network_id is not in
'networks_by_id'. This means it is a OVN bridge MAC
port and should be ignored.

This change is the original patch, and the partial
revert squashed in.

Related: blueprint network-data-v2-ports
Closes-Bug: #1928469
Depends-On: https://review.opendev.org/790687
Change-Id: Ife65326509e1d5fe7689c1baec17d902ec848c0d
(cherry picked from commit 14441478f9)
(cherry picked from commit d328637713)
This commit is contained in:
Harald Jensås 2021-05-11 00:58:04 +02:00
parent 8ed7631a3f
commit 0a7cfe3934
1 changed files with 4 additions and 0 deletions

View File

@ -132,6 +132,10 @@ class NeutronData(object):
ports_by_role_and_host = {}
for port in self.ports:
# Ignore ports in networks we ignore, i.e the OVN Bridge MAC net
if port.network_id not in self.networks_by_id:
continue
tags = self._tags_to_dict(port.tags)
# In case of missing required tags, raise an error.
# neutron is useless as a inventory source in this case.