From 0a7cfe39343e302875b07b400c224bdd2e6be578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Tue, 11 May 2021 00:58:04 +0200 Subject: [PATCH] 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 14441478f944d0e07d107191d59fbb9024ced512) (cherry picked from commit d3286377132ee6b0689a39e52858c07954711d13) --- tripleo_common/inventory.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tripleo_common/inventory.py b/tripleo_common/inventory.py index 1b1fc8279..104961467 100644 --- a/tripleo_common/inventory.py +++ b/tripleo_common/inventory.py @@ -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.