From 2d3e376a2c351191164306ea23158ccd7b985454 Mon Sep 17 00:00:00 2001 From: Ji-Wei Date: Sat, 3 Sep 2016 12:44:18 +0800 Subject: [PATCH] Raise NotImplementedError instead of NotImplemented NotImplementedError is the name of the exception (https://docs.python.org/2/library/exceptions.html). NotImplemented is the name of a constant (https://docs.python.org/2/library/constants.html). This patch fix it. Change-Id: Icfbc0603d03e2001d1494027c492059687e15fa7 Closes-Bug: #1339855 --- keystoneauth1/extras/_saml2/v3/saml2.py | 2 +- keystoneauth1/identity/v3/base.py | 4 ++-- keystoneauth1/identity/v3/oidc.py | 2 +- keystoneauth1/loading/base.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/keystoneauth1/extras/_saml2/v3/saml2.py b/keystoneauth1/extras/_saml2/v3/saml2.py index 7b0b37a4..696d6ff0 100644 --- a/keystoneauth1/extras/_saml2/v3/saml2.py +++ b/keystoneauth1/extras/_saml2/v3/saml2.py @@ -227,7 +227,7 @@ class _FederatedSaml(v3.FederationBaseAuth): @abc.abstractmethod def get_requests_auth(self): - raise NotImplemented() + raise NotImplementedError() def get_unscoped_auth_ref(self, session, **kwargs): method = self.get_requests_auth() diff --git a/keystoneauth1/identity/v3/base.py b/keystoneauth1/identity/v3/base.py index 837e61d9..08cc6848 100644 --- a/keystoneauth1/identity/v3/base.py +++ b/keystoneauth1/identity/v3/base.py @@ -194,7 +194,7 @@ class Auth(BaseAuth): for method in self.auth_methods: try: elements = method.get_cache_id_elements() - except NotImplemented: + except NotImplementedError: return None params.update(elements) @@ -259,7 +259,7 @@ class AuthMethod(object): should be prefixed with the plugin identifier. For example the password plugin returns its username value as 'password_username'. """ - raise NotImplemented() + raise NotImplementedError() @six.add_metaclass(abc.ABCMeta) diff --git a/keystoneauth1/identity/v3/oidc.py b/keystoneauth1/identity/v3/oidc.py index d8115ae9..08c4a365 100644 --- a/keystoneauth1/identity/v3/oidc.py +++ b/keystoneauth1/identity/v3/oidc.py @@ -280,7 +280,7 @@ class _OidcBase(federation.FederationBaseAuth): :returns: a python dictionary containing the payload to be exchanged :rtype: dict """ - raise NotImplemented() + raise NotImplementedError() class OidcPassword(_OidcBase): diff --git a/keystoneauth1/loading/base.py b/keystoneauth1/loading/base.py index 8c2b5f46..ec91d076 100644 --- a/keystoneauth1/loading/base.py +++ b/keystoneauth1/loading/base.py @@ -104,7 +104,7 @@ class BaseLoader(object): @property def plugin_class(self): - raise NotImplemented() + raise NotImplementedError() def create_plugin(self, **kwargs): """Create a plugin from the options available for the loader.