diff options
author | Matt Riedemann <mriedem@us.ibm.com> | 2014-03-30 14:40:38 -0700 |
---|---|---|
committer | Matt Riedemann <mriedem@us.ibm.com> | 2014-04-25 12:37:07 -0700 |
commit | c75a15a48981628e77d4178476c121693a656814 (patch) | |
tree | 93dba8c5294f6eb640241df3d6868664609b1f1f /nova/tests/image | |
parent | 296f2fa1831d2dff5a96796e251ecf0e3703b56e (diff) | |
download | nova-c75a15a48981628e77d4178476c121693a656814.tar.gz |
Rename NotAuthorized exception to Forbidden
The NotAuthorized NovaException has an internal code of 403 which is
actually Forbidden, so rename it appropriately.
This patch doesn't change the external behavior, the status code in
responses will still be 403 but the exception is just named properly.
This is also necessary to create an actual Unauthorized NovaException
with code 401 for use in some Neutron API bug fixes for more granular
error handling from python-neutronclient.
Related-Bug: #1298075
Change-Id: I691fac2e2c797f47c04da7965d7b1c8685c74edb
Diffstat (limited to 'nova/tests/image')
-rw-r--r-- | nova/tests/image/test_glance.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/tests/image/test_glance.py b/nova/tests/image/test_glance.py index 51efa905cd..47ce5bdd44 100644 --- a/nova/tests/image/test_glance.py +++ b/nova/tests/image/test_glance.py @@ -777,14 +777,14 @@ class TestDetail(test.NoDBTestCase): ext_query_mock, reraise_mock): params = {} ext_query_mock.return_value = params - raised = exception.NotAuthorized() + raised = exception.Forbidden() client = mock.MagicMock() client.call.side_effect = glanceclient.exc.Forbidden ctx = mock.sentinel.ctx reraise_mock.side_effect = raised service = glance.GlanceImageService(client) - with testtools.ExpectedException(exception.NotAuthorized): + with testtools.ExpectedException(exception.Forbidden): service.detail(ctx, **params) client.call.assert_called_once_with(ctx, 1, 'list') |