diff --git a/keystoneauth1/access/access.py b/keystoneauth1/access/access.py index e7ff207c..cf834fbf 100644 --- a/keystoneauth1/access/access.py +++ b/keystoneauth1/access/access.py @@ -116,7 +116,7 @@ class AccessInfo(object): @property def expires(self): - """Return the token expiration (as datetime object) + """Return the token expiration (as datetime object). :returns: datetime """ @@ -124,7 +124,7 @@ class AccessInfo(object): @property def issued(self): - """Return the token issue time (as datetime object) + """Return the token issue time (as datetime object). :returns: datetime """ diff --git a/keystoneauth1/adapter.py b/keystoneauth1/adapter.py index b2d92fb4..bf0ec519 100644 --- a/keystoneauth1/adapter.py +++ b/keystoneauth1/adapter.py @@ -189,7 +189,7 @@ class Adapter(object): @classmethod def register_argparse_arguments(cls, parser, service_type=None): - """Attach arguments to a given argparse Parser for Adapters + """Attach arguments to a given argparse Parser for Adapters. :param parser: The argparse parser to attach options to. :type parser: argparse.ArgumentParser @@ -238,7 +238,7 @@ class Adapter(object): @classmethod def register_service_argparse_arguments(cls, parser, service_type): - """Attach arguments to a given argparse Parser for Adapters + """Attach arguments to a given argparse Parser for Adapters. :param parser: The argparse parser to attach options to. :type parser: argparse.ArgumentParser diff --git a/keystoneauth1/exceptions/http.py b/keystoneauth1/exceptions/http.py index eb842fd3..2e526e4e 100644 --- a/keystoneauth1/exceptions/http.py +++ b/keystoneauth1/exceptions/http.py @@ -17,7 +17,7 @@ # under the License. """ -HTTP Exceptions used by keystoneauth1 +HTTP Exceptions used by keystoneauth1. """ import inspect diff --git a/keystoneauth1/exceptions/service_providers.py b/keystoneauth1/exceptions/service_providers.py index a033e8dc..ec24951b 100644 --- a/keystoneauth1/exceptions/service_providers.py +++ b/keystoneauth1/exceptions/service_providers.py @@ -16,7 +16,8 @@ __all__ = ('ServiceProviderNotFound',) class ServiceProviderNotFound(base.ClientException): - """A Service Provider cannot be found""" + """A Service Provider cannot be found. + """ def __init__(self, sp_id): self.sp_id = sp_id diff --git a/keystoneauth1/extras/_saml2/v3/base.py b/keystoneauth1/extras/_saml2/v3/base.py index ee25e395..cdb1bc76 100644 --- a/keystoneauth1/extras/_saml2/v3/base.py +++ b/keystoneauth1/extras/_saml2/v3/base.py @@ -35,7 +35,7 @@ class BaseSAMLPlugin(v3.FederationBaseAuth): identity_provider, identity_provider_url, username, password, protocol, **kwargs): - """Class constructor accepting following parameters: + """Class constructor accepting following parameters. :param auth_url: URL of the Identity Service :type auth_url: string @@ -46,8 +46,9 @@ class BaseSAMLPlugin(v3.FederationBaseAuth): obtain unscoped OpenStack token. :type identity_provider: string - :param identity_provider_url: An Identity Provider URL, where the SAML2 - authn request will be sent. + :param identity_provider_url: An Identity Provider URL, where the + SAML2 auhentication request will be + sent. :type identity_provider_url: string :param username: User's login diff --git a/keystoneauth1/fixture/__init__.py b/keystoneauth1/fixture/__init__.py index 15d695b7..8bfe6e33 100644 --- a/keystoneauth1/fixture/__init__.py +++ b/keystoneauth1/fixture/__init__.py @@ -11,8 +11,7 @@ # under the License. """ -The generators in this directory produce keystone compliant structures for use -in testing. +Produce keystone compliant structures for use in testing. They are part of the public API because they may be relied upon to generate test tokens for other clients. However they should never be imported into the diff --git a/keystoneauth1/fixture/keystoneauth_betamax.py b/keystoneauth1/fixture/keystoneauth_betamax.py index 26c92cca..d2e185b6 100644 --- a/keystoneauth1/fixture/keystoneauth_betamax.py +++ b/keystoneauth1/fixture/keystoneauth_betamax.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -"""A fixture to wrap the session constructor for use with Betamax""" +"""A fixture to wrap the session constructor for use with Betamax.""" from functools import partial diff --git a/keystoneauth1/identity/v2.py b/keystoneauth1/identity/v2.py index 8fc96722..933657a4 100644 --- a/keystoneauth1/identity/v2.py +++ b/keystoneauth1/identity/v2.py @@ -86,7 +86,7 @@ class Auth(base.BaseIdentityPlugin): @property def has_scope_parameters(self): - """Return true if parameters can be used to create a scoped token""" + """Return true if parameters can be used to create a scoped token.""" return self.tenant_id or self.tenant_name or self.trust_id diff --git a/keystoneauth1/identity/v3/base.py b/keystoneauth1/identity/v3/base.py index 3c0431de..837e61d9 100644 --- a/keystoneauth1/identity/v3/base.py +++ b/keystoneauth1/identity/v3/base.py @@ -77,7 +77,7 @@ class BaseAuth(base.BaseIdentityPlugin): @property def has_scope_parameters(self): - """Return true if parameters can be used to create a scoped token""" + """Return true if parameters can be used to create a scoped token.""" return (self.domain_id or self.domain_name or self.project_id or self.project_name or self.trust_id) diff --git a/keystoneauth1/identity/v3/k2k.py b/keystoneauth1/identity/v3/k2k.py index 655bb63b..2f4520b4 100644 --- a/keystoneauth1/identity/v3/k2k.py +++ b/keystoneauth1/identity/v3/k2k.py @@ -50,7 +50,7 @@ class Keystone2Keystone(federation._Rescoped): @classmethod def _remote_auth_url(cls, auth_url): - """Return auth_url of the remote Keystone Service Provider + """Return auth_url of the remote Keystone Service Provider. Remote cloud's auth_url is an endpoint for getting federated unscoped token, typically that would be diff --git a/keystoneauth1/identity/v3/oidc.py b/keystoneauth1/identity/v3/oidc.py index 49bbe504..4f497292 100644 --- a/keystoneauth1/identity/v3/oidc.py +++ b/keystoneauth1/identity/v3/oidc.py @@ -20,7 +20,7 @@ __all__ = ('OidcAuthorizationCode', class _OidcBase(federation.FederationBaseAuth): - """Base class for different OpenID Connect based flows + """Base class for different OpenID Connect based flows. The OpenID Connect specification can be found at:: ``http://openid.net/specs/openid-connect-core-1_0.html`` @@ -29,7 +29,7 @@ class _OidcBase(federation.FederationBaseAuth): def __init__(self, auth_url, identity_provider, protocol, client_id, client_secret, access_token_endpoint, grant_type, access_token_type, **kwargs): - """The OpenID Connect plugin expects the following: + """The OpenID Connect plugin expects the following. :param auth_url: URL of the Identity Service :type auth_url: string @@ -130,14 +130,15 @@ class _OidcBase(federation.FederationBaseAuth): class OidcPassword(_OidcBase): - """Implementation for OpenID Connect Resource Owner Password Credential""" + """Implementation for OpenID Connect Resource Owner Password Credential. + """ @positional(4) def __init__(self, auth_url, identity_provider, protocol, client_id, client_secret, access_token_endpoint, grant_type='password', access_token_type='access_token', username=None, password=None, scope='profile'): - """The OpenID Password plugin expects the following: + """The OpenID Password plugin expects the following. :param username: Username used to authenticate :type username: string @@ -201,7 +202,7 @@ class OidcPassword(_OidcBase): class OidcAuthorizationCode(_OidcBase): - """Implementation for OpenID Connect Authorization Code""" + """Implementation for OpenID Connect Authorization Code.""" @positional(4) def __init__(self, auth_url, identity_provider, protocol, @@ -209,7 +210,7 @@ class OidcAuthorizationCode(_OidcBase): grant_type='authorization_code', access_token_type='access_token', redirect_uri=None, code=None): - """The OpenID Authorization Code plugin expects the following: + """The OpenID Authorization Code plugin expects the following. :param redirect_uri: OpenID Connect Client Redirect URL :type redirect_uri: string diff --git a/keystoneauth1/loading/base.py b/keystoneauth1/loading/base.py index 3ed1183c..1a93f2e3 100644 --- a/keystoneauth1/loading/base.py +++ b/keystoneauth1/loading/base.py @@ -125,7 +125,7 @@ class BaseLoader(object): return self.plugin_class(**kwargs) def load_from_options_getter(self, getter, **kwargs): - """Load a plugin from a getter function that returns appropriate values + """Load a plugin from getter function that returns appropriate values. To handle cases other than the provided CONF and CLI loading you can specify a custom loader function that will be queried for the option diff --git a/keystoneauth1/plugin.py b/keystoneauth1/plugin.py index aa5171ad..3551a0d3 100644 --- a/keystoneauth1/plugin.py +++ b/keystoneauth1/plugin.py @@ -176,7 +176,7 @@ class BaseAuthPlugin(object): return None def get_sp_auth_url(self, session, sp_id, **kwargs): - """Return auth_url from the Service Provider object + """Return auth_url from the Service Provider object. This url is used for obtaining unscoped federated token from remote cloud. @@ -191,7 +191,7 @@ class BaseAuthPlugin(object): return None def get_sp_url(self, session, sp_id, **kwargs): - """Return sp_url from the Service Provider object + """Return sp_url from the Service Provider object. This url is used for passing SAML2 assertion to the remote cloud. diff --git a/keystoneauth1/session.py b/keystoneauth1/session.py index f5591ef9..494a6fb5 100644 --- a/keystoneauth1/session.py +++ b/keystoneauth1/session.py @@ -72,7 +72,7 @@ class _JSONEncoder(json.JSONEncoder): class _StringFormatter(object): - """A String formatter that fetches values on demand""" + """A String formatter that fetches values on demand.""" def __init__(self, session, auth): self.session = session diff --git a/keystoneauth1/tests/unit/test_session.py b/keystoneauth1/tests/unit/test_session.py index 67be1358..94e545be 100644 --- a/keystoneauth1/tests/unit/test_session.py +++ b/keystoneauth1/tests/unit/test_session.py @@ -140,7 +140,7 @@ class SessionTests(utils.TestCase): session.get, self.TEST_URL) def test_session_debug_output(self): - """Test request and response headers in debug logs + """Test request and response headers in debug logs. in order to redact secure headers while debug is true. """ @@ -175,7 +175,7 @@ class SessionTests(utils.TestCase): self.assertNotIn(v, self.logger.output) def test_logs_failed_output(self): - """Test that output is logged even for failed requests""" + """Test that output is logged even for failed requests.""" session = client_session.Session() body = uuid.uuid4().hex diff --git a/keystoneauth1/tests/unit/utils.py b/keystoneauth1/tests/unit/utils.py index e9361445..bbd94ce4 100644 --- a/keystoneauth1/tests/unit/utils.py +++ b/keystoneauth1/tests/unit/utils.py @@ -99,7 +99,7 @@ class TestCase(testtools.TestCase): self.assertIn(v, qs[k]) def assertRequestHeaderEqual(self, name, val): - """Verify that the last request made contains a header and its value + """Verify that the last request made contains a header and its value. The request must have already been made. """ diff --git a/tox.ini b/tox.ini index b618ca16..18ac6879 100644 --- a/tox.ini +++ b/tox.ini @@ -43,8 +43,7 @@ commands = oslo_debug_helper -t keystoneauth1/tests {posargs} # D208: Docstring is over-indented # D211: No blank lines allowed before class docstring # D301: Use r”“” if any backslashes in a docstring -# D400: First line should end with a period. -ignore = H405,D100,D101,D102,D103,D104,D105,D200,D203,D204,D205,D208,D211,D301,D400 +ignore = H405,D100,D101,D102,D103,D104,D105,D200,D203,D204,D205,D208,D211,D301 show-source = True exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*