[openstack-dev] [Nova] python 3 tests hate my exception handling

Neill Cox neill.cox at ingenious.com.au
Wed Jan 4 04:37:55 UTC 2017


I had a quick poke at this, and came to the same conclusion as Tim - 
that the problem was the from_response function.

Getting rid of that allows the code to run under python3, but with the 
possibility of missing some of the exceptions from 
keystoneauth1.exceptions.http.__all__ . To make sure that doesn't happen 
you'll need to iterate through the values in 
ks_exceptions.http._code_map adding any that you don't already have.

This is all starting to get a bit hackish, and is likely fragile as it 
is relying on things that I doubt the authors intended to expose, but 
some sample code that seems to work is at: 
https://gist.github.com/neillc/cd6934a57f918988037e8c644d1d31ac

Good luck if you decide to use it...

Cheers,
Neill

Rackspace Australia




More information about the OpenStack-dev mailing list