Search for the router network in specified project

If we have multiple networks with the same name in different projects,
we will get an error in a global search. So first we should search in
specified project and only if the network is missing there, do a global
search. This should allow creation of multiple projects with the routers
using the same network names.

Change-Id: I40f41a6ee3e18d7cb2fc7fdd375539066444f3fb
Signed-off-by: Denys Mishchenko <denys.mishchenko@cleura.com>
This commit is contained in:
Denys Mishchenko
2026-09-09 12:04:40 +02:00
parent 6924032c86
commit 876823b88e
2 changed files with 11 additions and 1 deletions
+3
View File
@@ -0,0 +1,3 @@
---
bugfixes:
- modules/router.py in function _build_router_interface_config network search will be performed in defined project first.
+8 -1
View File
@@ -497,8 +497,15 @@ class RouterModule(OpenStackModule):
if 'net' not in iface:
self.fail(
"Network name missing from interface definition")
# First try to find a network in the specified project.
net = self.conn.network.find_network(iface['net'],
ignore_missing=False)
ignore_missing=False,
**filters)
# Fall back to a global search for the network.
if not net:
net = self.conn.network.find_network(
iface['net'],
ignore_missing=False)
if 'portip' not in iface:
# portip not set, add any ip from subnet