Skip to content

Commit

Permalink
Automatically find external network
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Büchse <matthias.buechse@cloudandheat.com>
  • Loading branch information
mbuechse committed Jan 18, 2024
1 parent 770624c commit 2987c80
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Tests/iaas/entropy/entropy-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,16 @@ def prepare(self):
}],
dns_nameservers=["9.9.9.9"],
)
external_gateway_net_id = \
"585ec5ec-5993-4042-93b9-264b0d82ac8e"
# "ebfe5546-f09f-4f42-ab54-094e457d42ec"
external_networks = list(self.conn.network.networks(is_router_external=True))
if not external_networks:
raise RuntimeError("No external network found!")
if len(external_networks) > 1:
logger.debug(
"More than one external network found: "
+ ', '.join([n.id for n in external_networks]) # noqa: W503
)
external_gateway_net_id = external_networks[0].id
logger.debug(f"Using external network {external_gateway_net_id}.")
self.router = self.conn.create_router(
ROUTER_NAME, ext_gateway_net_id=external_gateway_net_id,
)
Expand Down

0 comments on commit 2987c80

Please sign in to comment.