]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Make glance image service check base exception classes
authorJohn Griffith <john.griffith@solidfire.com>
Wed, 22 Aug 2012 22:26:15 +0000 (16:26 -0600)
committerJohn Griffith <john.griffith@solidfire.com>
Wed, 22 Aug 2012 22:27:56 +0000 (16:27 -0600)
commit4aebd529f979ed51f46c27b20ed5fe34e48757f7
treec582de747f7a6e387dc082fe404679ebf9ba4563
parent4e81c907bbb9d94d4b76b00ff591418374175d41
Make glance image service check base exception classes

Fixes bug 1039675

glanceclient can raise HTTPNotFound (as well as NotFound) it appears,
but glance image service is only converting NotFound ->
InstanceNotFound.  Same applies to 'Forbidden' and other exceptions.

This patch converts 'exc_type is NotFound'-like checks to use
'isinstance' instead, which will cover HTTPNotFound, etc.

Also add missing glance/image tests that weren't in Cinder

Change-Id: I8787598daccf401a26d9397946ecd55f89ff62b3
cinder/image/glance.py
cinder/tests/glance/__init__.py [new file with mode: 0644]
cinder/tests/glance/stubs.py [new file with mode: 0644]
cinder/tests/image/test_glance.py [new file with mode: 0644]