Browse Source

Ignore non host ports by tag filtering

Don't include tripleo_vip_net and tripleo_service_vip
ports when generating the inventory.

Closes-Bug: #1928469
Change-Id: I3db93dd6aa493da6f1c059b1c49eb0fa0f3179fc
changes/60/792260/1
Harald Jensås 4 months ago
parent
commit
0a35f94522
  1. 5
      tripleo_common/inventory.py

5
tripleo_common/inventory.py

@ -129,6 +129,7 @@ class NeutronData(object):
def _ports_by_role_and_host(self):
mandatory_tags = {'tripleo_role'}
ignore_tags = {'tripleo_vip_net', 'tripleo_service_vip'}
ports_by_role_and_host = {}
for port in self.ports:
@ -137,6 +138,10 @@ class NeutronData(object):
continue
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.
# neutron is useless as a inventory source in this case.
if not mandatory_tags.issubset(tags):

Loading…
Cancel
Save