Merge "Check for no neutron network in inventory"

This commit is contained in:
Zuul 2021-07-02 21:07:05 +00:00 committed by Gerrit Code Review
commit e459428d9f
1 changed files with 9 additions and 4 deletions

View File

@ -500,10 +500,15 @@ class TripleoInventory(object):
found_ctlplane_port = False
ctlplane_net = self.connection.network.find_network(
self.host_network)
for p in ports:
if p.network_id == ctlplane_net.id:
found_ctlplane_port = True
break
if ctlplane_net:
for p in ports:
if p.network_id == ctlplane_net.id:
found_ctlplane_port = True
break
else:
LOG.warning("Host SSH network %s not found in neutron, not "
"using neutron data for inventory",
self.host_network)
if not found_ctlplane_port:
return None