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
This commit is contained in:
		
				
					committed by
					
						
						Stephen Finucane
					
				
			
			
				
	
			
			
			
						parent
						
							067261e80d
						
					
				
				
					commit
					b0936c5b30
				
			@@ -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,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user