From b0936c5b3031a0abe50dcf004666e2f58909aa82 Mon Sep 17 00:00:00 2001 From: Nate Johnston Date: Fri, 15 Nov 2019 10:13:13 -0500 Subject: [PATCH] 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 --- openstackclient/network/v2/floating_ip.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openstackclient/network/v2/floating_ip.py b/openstackclient/network/v2/floating_ip.py index a94e58b62f..86e517ff0c 100644 --- a/openstackclient/network/v2/floating_ip.py +++ b/openstackclient/network/v2/floating_ip.py @@ -12,6 +12,7 @@ """IP Floating action implementations""" +from openstack import exceptions as sdk_exceptions from osc_lib import utils from osc_lib.utils import tags as _tag @@ -390,7 +391,10 @@ class ListFloatingIP(common.NetworkAndComputeLister): _tag.get_tag_filtering_args(parsed_args, query) - data = client.ips(**query) + try: + data = list(client.ips(**query)) + except sdk_exceptions.NotFoundException: + data = [] return ( headers,