Skip to content

Commit b0936c5

Browse files
nate-johnstonstephenfin
authored andcommitted
Handle NotFoundException when listing floating IPs
Asking for floating IPs on an undercloud results in a NotFoundException. Make openstackclient handle it gracefully. No test is added for this because it would need to be a scenario test - deploying a cloud without the foalting IP extension loaded. I don't think this edge case is worth an entire new job just to exercise it. Change-Id: I73b544853376d98ab0dbb14e32fefc43c1a8a179 Story: 2006863
1 parent 067261e commit b0936c5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

openstackclient/network/v2/floating_ip.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
"""IP Floating action implementations"""
1414

15+
from openstack import exceptions as sdk_exceptions
1516
from osc_lib import utils
1617
from osc_lib.utils import tags as _tag
1718

@@ -390,7 +391,10 @@ def take_action_network(self, client, parsed_args):
390391

391392
_tag.get_tag_filtering_args(parsed_args, query)
392393

393-
data = client.ips(**query)
394+
try:
395+
data = list(client.ips(**query))
396+
except sdk_exceptions.NotFoundException:
397+
data = []
394398

395399
return (
396400
headers,

0 commit comments

Comments
 (0)