From b119c1be6dc2bf9fd7b8c7fd06c808c55c61bf0d Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 17 Sep 2024 00:55:57 +0900 Subject: [PATCH] Fix internal error when floating ip network is not found by name Ensure that the appropriate exception (NotFoundException) is raised in case the network is not found by the specified name, to avoid ugly TypeError raised from internal logic. Closes-Bug: #2080859 Co-Authored-By: Alexander Stepanov Change-Id: I12ee35c1fc1bd9691b230f0b5e3de9111f0d46a7 --- openstack/cloud/_network_common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openstack/cloud/_network_common.py b/openstack/cloud/_network_common.py index 43633d7cd..b504eb114 100644 --- a/openstack/cloud/_network_common.py +++ b/openstack/cloud/_network_common.py @@ -806,7 +806,9 @@ class NetworkCommonCloudMixin(openstackcloud._OpenStackCloudMixin): if not network_id: if network_name_or_id: try: - network = self.network.find_network(network_name_or_id) + network = self.network.find_network( + network_name_or_id, ignore_missing=False + ) except exceptions.NotFoundException: raise exceptions.NotFoundException( "unable to find network for floating ips with ID "