diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-02-25 15:42:01 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-02-25 15:42:01 +0000 |
commit | 9b5de096fe264d7e40c326c20d40a67f69029b69 (patch) | |
tree | 164a1f06d2de5de8f408594d6f97490c98ace91a | |
parent | b8f9b2516cf8ff0f753f62771ae1234223e96a80 (diff) | |
parent | d483b9872656020d936e441b267bdb83d6a3804a (diff) | |
download | keystone-9b5de096fe264d7e40c326c20d40a67f69029b69.tar.gz |
Merge "Remove redundant default value None for dict.get"
-rw-r--r-- | keystone/auth/plugins/password.py | 2 | ||||
-rw-r--r-- | keystone/common/serializer.py | 4 | ||||
-rw-r--r-- | keystone/tests/rest.py | 2 | ||||
-rw-r--r-- | keystone/tests/test_v3_federation.py | 2 | ||||
-rw-r--r-- | keystone/token/controllers.py | 8 |
5 files changed, 9 insertions, 9 deletions
diff --git a/keystone/auth/plugins/password.py b/keystone/auth/plugins/password.py index 42a1fbb63..a0db091a2 100644 --- a/keystone/auth/plugins/password.py +++ b/keystone/auth/plugins/password.py @@ -77,7 +77,7 @@ class UserAuthInfo(object): if not user_id and not user_name: raise exception.ValidationError(attribute='id or name', target='user') - self.password = user_info.get('password', None) + self.password = user_info.get('password') try: if user_name: if 'domain' not in user_info: diff --git a/keystone/common/serializer.py b/keystone/common/serializer.py index 93b9eb4ec..cfb3941b5 100644 --- a/keystone/common/serializer.py +++ b/keystone/common/serializer.py @@ -96,7 +96,7 @@ class XmlDeserializer(object): prefix = None for xmlns in XMLNS_LIST: if xmlns['value'] == ns: - prefix = xmlns.get('prefix', None) + prefix = xmlns.get('prefix') break if prefix is not None: return '%(PREFIX)s:%(tag_name)s' \ @@ -209,7 +209,7 @@ class XmlSerializer(object): root_name = m.string[m.start():] prefix = m.string[0:m.start() - 1] for ns in XMLNS_LIST: - if prefix == ns.get('prefix', None): + if prefix == ns.get('prefix'): xmlns = ns['value'] break # only the root dom element gets an xlmns diff --git a/keystone/tests/rest.py b/keystone/tests/rest.py index 83948bcb5..598cf914d 100644 --- a/keystone/tests/rest.py +++ b/keystone/tests/rest.py @@ -162,7 +162,7 @@ class RestfulTestCase(tests.TestCase): if response.body is not None and response.body.strip(): # if a body is provided, a Content-Type is also expected - header = response.headers.get('Content-Type', None) + header = response.headers.get('Content-Type') self.assertIn(content_type, header) if content_type == 'json': diff --git a/keystone/tests/test_v3_federation.py b/keystone/tests/test_v3_federation.py index 291c866a8..22303203d 100644 --- a/keystone/tests/test_v3_federation.py +++ b/keystone/tests/test_v3_federation.py @@ -62,7 +62,7 @@ class FederatedIdentityProviderTests(FederationTests): def _fetch_attribute_from_response(self, resp, parameter, assert_is_not_none=True): """Fetch single attribute from TestResponse object.""" - result = resp.result.get(parameter, None) + result = resp.result.get(parameter) if assert_is_not_none: self.assertIsNotNone(result) return result diff --git a/keystone/token/controllers.py b/keystone/token/controllers.py index 593196862..f71cad0c4 100644 --- a/keystone/token/controllers.py +++ b/keystone/token/controllers.py @@ -215,7 +215,7 @@ class Auth(controller.V2Controller): metadata_ref['trustee_user_id'] = trust_ref['trustee_user_id'] metadata_ref['trust_id'] = trust_id - bind = old_token_ref.get('bind', None) + bind = old_token_ref.get('bind') return (current_user_ref, tenant_ref, metadata_ref, expiry, bind) @@ -243,7 +243,7 @@ class Auth(controller.V2Controller): attribute='username or userId', target='passwordCredentials') - user_id = auth['passwordCredentials'].get('userId', None) + user_id = auth['passwordCredentials'].get('userId') if user_id and len(user_id) > CONF.max_param_size: raise exception.ValidationSizeError(attribute='userId', size=CONF.max_param_size) @@ -323,12 +323,12 @@ class Auth(controller.V2Controller): Returns a valid tenant_id if it exists, or None if not specified. """ - tenant_id = auth.get('tenantId', None) + tenant_id = auth.get('tenantId') if tenant_id and len(tenant_id) > CONF.max_param_size: raise exception.ValidationSizeError(attribute='tenantId', size=CONF.max_param_size) - tenant_name = auth.get('tenantName', None) + tenant_name = auth.get('tenantName') if tenant_name and len(tenant_name) > CONF.max_param_size: raise exception.ValidationSizeError(attribute='tenantName', size=CONF.max_param_size) |