Send proper exception info as expected by the neutron client
The python neutron client for the V2 API expects the neutron API to send information back such as the type and detail of the exception in the body of the message Change-Id: I9486d757258c4be72799c41102babe1f7923121c Closes-bug: #1226400
This commit is contained in:
		@@ -86,7 +86,10 @@ def Resource(controller, faults=None, deserializers=None, serializers=None):
 | 
			
		||||
                netaddr.AddrFormatError) as e:
 | 
			
		||||
            LOG.exception(_('%s failed'), action)
 | 
			
		||||
            e = translate(e, language)
 | 
			
		||||
            body = serializer.serialize({'NeutronError': e})
 | 
			
		||||
            # following structure is expected by python-neutronclient
 | 
			
		||||
            err_data = {'type': e.__class__.__name__,
 | 
			
		||||
                        'message': e, 'detail': ''}
 | 
			
		||||
            body = serializer.serialize({'NeutronError': err_data})
 | 
			
		||||
            kwargs = {'body': body, 'content_type': content_type}
 | 
			
		||||
            for fault in faults:
 | 
			
		||||
                if isinstance(e, fault):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user