Merge "Ignore non host ports by tag filtering" into stable/wallaby

This commit is contained in:
Zuul 2021-06-03 02:59:02 +00:00 committed by Gerrit Code Review
commit df8a5fee22
1 changed files with 5 additions and 0 deletions

View File

@ -129,6 +129,7 @@ class NeutronData(object):
def _ports_by_role_and_host(self): def _ports_by_role_and_host(self):
mandatory_tags = {'tripleo_role'} mandatory_tags = {'tripleo_role'}
ignore_tags = {'tripleo_vip_net', 'tripleo_service_vip'}
ports_by_role_and_host = {} ports_by_role_and_host = {}
for port in self.ports: for port in self.ports:
@ -137,6 +138,10 @@ class NeutronData(object):
continue continue
tags = self._tags_to_dict(port.tags) tags = self._tags_to_dict(port.tags)
# Ignore non host ports by looking for the tags
if ignore_tags.intersection(tags):
continue
# In case of missing required tags, raise an error. # In case of missing required tags, raise an error.
# neutron is useless as a inventory source in this case. # neutron is useless as a inventory source in this case.
if not mandatory_tags.issubset(tags): if not mandatory_tags.issubset(tags):