Merge "Catch ImageNotAuthorized during boot instance" into stable/newton
This commit is contained in:
commit
ec8c78b7eb
@ -653,6 +653,7 @@ class ServersController(wsgi.Controller):
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except (exception.ImageNotActive,
|
||||
exception.ImageBadRequest,
|
||||
exception.ImageNotAuthorized,
|
||||
exception.FixedIpNotFoundForAddress,
|
||||
exception.FlavorNotFound,
|
||||
exception.FlavorDiskTooSmall,
|
||||
|
@ -3241,6 +3241,14 @@ class ServersControllerCreateTest(test.TestCase):
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self._test_create_extra, {})
|
||||
|
||||
@mock.patch.object(compute_api.API, 'create',
|
||||
side_effect=exception.ImageNotAuthorized(
|
||||
project_id=FAKE_UUID))
|
||||
def test_create_instance_with_image_not_authorized(self,
|
||||
mock_create):
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self._test_create_extra, {})
|
||||
|
||||
@mock.patch.object(compute_api.API, 'create',
|
||||
side_effect=exception.InstanceExists(
|
||||
name='instance-name'))
|
||||
|
Loading…
Reference in New Issue
Block a user