diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-08-13 20:27:56 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-08-13 20:27:56 +0000 |
| commit | 3fc3dbe6ab6149f5650f777b3a89c650ae3945e9 (patch) | |
| tree | 29a4bbfe4bfa1131a7552df322bf029cac405cce /nova/api | |
| parent | 7de1aca7661dc7308c75cc9ded83ce4f7bfa0432 (diff) | |
| parent | 5646b96119947ba1b3086ac598d9c97bee3fca58 (diff) | |
Merge "Fix TypeError conversion in API layer"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/wsgi.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index 3ea7c1c7c..9f8bf6367 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -628,7 +628,11 @@ class ResourceExceptionHandler(object): elif isinstance(ex_value, exception.Invalid): raise Fault(exception.ConvertedException( code=ex_value.code, explanation=unicode(ex_value))) - elif isinstance(ex_value, TypeError): + + # Under python 2.6, TypeError's exception value is actually a string, + # so test # here via ex_type instead: + # http://bugs.python.org/issue7853 + elif issubclass(ex_type, TypeError): exc_info = (ex_type, ex_value, ex_traceback) LOG.error(_('Exception handling resource: %s') % ex_value, exc_info=exc_info) |
