mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-11-23 15:40:24 +00:00
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:
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- modules/router.py in function _build_router_interface_config network search will be performed in defined project first.
|
||||||
@@ -497,8 +497,15 @@ class RouterModule(OpenStackModule):
|
|||||||
if 'net' not in iface:
|
if 'net' not in iface:
|
||||||
self.fail(
|
self.fail(
|
||||||
"Network name missing from interface definition")
|
"Network name missing from interface definition")
|
||||||
|
# First try to find a network in the specified project.
|
||||||
net = self.conn.network.find_network(iface['net'],
|
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:
|
if 'portip' not in iface:
|
||||||
# portip not set, add any ip from subnet
|
# portip not set, add any ip from subnet
|
||||||
|
|||||||
Reference in New Issue
Block a user