diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-04-23 18:07:22 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-04-23 18:07:22 +0000 |
| commit | eefc8e047392c80388391a5d1ae815e93df10849 (patch) | |
| tree | 2b47147bc7d62b5d36fbbf50058f444730b4e58a | |
| parent | 4960ce161ce29601957b43eb45f15ced3ecbde0d (diff) | |
| parent | 6f4096bc884339110eef719831bfa91d9b1d2e63 (diff) | |
Merge "clean up invalid variable reference"
| -rw-r--r-- | keystone/auth/controllers.py | 2 | ||||
| -rw-r--r-- | tests/test_v3_auth.py | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/keystone/auth/controllers.py b/keystone/auth/controllers.py index 67a86442..0cb070bc 100644 --- a/keystone/auth/controllers.py +++ b/keystone/auth/controllers.py @@ -237,7 +237,7 @@ class AuthInfo(object): """ if method not in self.auth['identity']['methods']: - raise exception.ValidationError(attribute=method_name, + raise exception.ValidationError(attribute=method, target='identity') return self.auth['identity'][method] diff --git a/tests/test_v3_auth.py b/tests/test_v3_auth.py index a292af2b..997165ec 100644 --- a/tests/test_v3_auth.py +++ b/tests/test_v3_auth.py @@ -83,6 +83,18 @@ class TestAuthInfo(test_v3.RestfulTestCase): None, auth_data) + def test_get_method_data_invalid_method(self): + auth_data = self.build_authentication_request( + user_id='test', + password='test')['auth'] + context = None + auth_info = auth.controllers.AuthInfo(context, auth_data) + + method_name = uuid.uuid4().hex + self.assertRaises(exception.ValidationError, + auth_info.get_method_data, + method_name) + class TestTokenAPIs(test_v3.RestfulTestCase): def setUp(self): |
