Fix D400 PEP257 violation

Currently tox ignores D400:
D400: First line should end with a period.

This change makes keystonemiddleware docstrings compliant with D400.

Change-Id: Icff2b744d72ae74492cfc6515b91f393fa2b50bf
This commit is contained in:
Navid Pustchi 2016-05-05 16:39:29 +00:00
parent 560603beb3
commit d7bf1a759d
8 changed files with 16 additions and 15 deletions

View File

@ -12,7 +12,7 @@
# under the License. # under the License.
""" """
Build open standard audit information based on incoming requests Build open standard audit information based on incoming requests.
AuditMiddleware filter should be placed after keystonemiddleware.auth_token AuditMiddleware filter should be placed after keystonemiddleware.auth_token
in the pipeline so that it can utilise the information the Identity server in the pipeline so that it can utilise the information the Identity server
@ -223,7 +223,7 @@ class OpenStackAuditApi(object):
return service return service
def _build_typeURI(self, req, service_type): def _build_typeURI(self, req, service_type):
"""Build typeURI of target """Build typeURI of target.
Combines service type and corresponding path for greater detail. Combines service type and corresponding path for greater detail.
""" """
@ -254,7 +254,7 @@ class OpenStackAuditApi(object):
return target return target
def get_target_resource(self, req): def get_target_resource(self, req):
"""Retrieve target information """Retrieve target information.
If discovery is enabled, target will attempt to retrieve information If discovery is enabled, target will attempt to retrieve information
from service catalog. If not, the information will be taken from from service catalog. If not, the information will be taken from
@ -351,7 +351,7 @@ class AuditMiddleware(object):
os.path.basename(sys.argv[0])) os.path.basename(sys.argv[0]))
def _emit_audit(self, context, event_type, payload): def _emit_audit(self, context, event_type, payload):
"""Emit audit notification """Emit audit notification.
if oslo.messaging enabled, send notification. if not, log event. if oslo.messaging enabled, send notification. if not, log event.
""" """

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
""" """
Token-based Authentication Middleware Token-based Authentication Middleware.
This WSGI component: This WSGI component:
@ -529,7 +529,7 @@ class BaseAuthProtocol(object):
raise ksm_exceptions.InvalidToken(_('Token authorization failed')) raise ksm_exceptions.InvalidToken(_('Token authorization failed'))
def _do_fetch_token(self, token): def _do_fetch_token(self, token):
"""Helper method to fetch a token and convert it into an AccessInfo""" """Helper method to fetch a token and convert it into an AccessInfo."""
data = self.fetch_token(token) data = self.fetch_token(token)
try: try:

View File

@ -37,7 +37,7 @@ class ConnectionGetTimeoutException(Exception):
class ConnectionPool(queue.Queue): class ConnectionPool(queue.Queue):
"""Base connection pool class """Base connection pool class.
This class implements the basic connection pool logic as an abstract base This class implements the basic connection pool logic as an abstract base
class. class.

View File

@ -188,7 +188,7 @@ class _AuthTokenRequest(webob.Request):
self._set_auth_headers(auth_ref, self._SERVICE_HEADER_PREFIX) self._set_auth_headers(auth_ref, self._SERVICE_HEADER_PREFIX)
def _all_auth_headers(self): def _all_auth_headers(self):
"""All the authentication headers that can be set on the request""" """All the authentication headers that can be set on the request."""
yield self._SERVICE_CATALOG_HEADER yield self._SERVICE_CATALOG_HEADER
yield self._USER_STATUS_HEADER yield self._USER_STATUS_HEADER
yield self._SERVICE_STATUS_HEADER yield self._SERVICE_STATUS_HEADER
@ -227,7 +227,7 @@ class _AuthTokenRequest(webob.Request):
@property @property
def token_auth(self): def token_auth(self):
"""The auth plugin that will be associated with this request""" """The auth plugin that will be associated with this request."""
return self.environ.get(self._TOKEN_AUTH) return self.environ.get(self._TOKEN_AUTH)
@token_auth.setter @token_auth.setter
@ -236,7 +236,7 @@ class _AuthTokenRequest(webob.Request):
@property @property
def token_info(self): def token_info(self):
"""The raw token dictionary retrieved by the middleware""" """The raw token dictionary retrieved by the middleware."""
return self.environ.get(self._TOKEN_INFO) return self.environ.get(self._TOKEN_INFO)
@token_info.setter @token_info.setter

View File

@ -12,7 +12,9 @@
# limitations under the License. # limitations under the License.
""" """
Run the echo service directly on port 8000 by executing the following:: Run the echo service.
The echo service can be run on port 8000 by executing the following::
$ python -m keystonemiddleware.echo $ python -m keystonemiddleware.echo

View File

@ -20,7 +20,7 @@
# See them for their copyright. # See them for their copyright.
""" """
S3 Token Middleware S3 Token Middleware.
This WSGI component: This WSGI component:

View File

@ -1511,7 +1511,7 @@ class v2AuthTokenMiddlewareTest(BaseAuthTokenMiddlewareTest,
self.set_middleware() self.set_middleware()
def assert_unscoped_default_tenant_auto_scopes(self, token): def assert_unscoped_default_tenant_auto_scopes(self, token):
"""Unscoped v2 requests with a default tenant should "auto-scope." """Unscoped v2 requests with a default tenant should ``auto-scope``.
The implied scope is the user's tenant ID. The implied scope is the user's tenant ID.

View File

@ -46,8 +46,7 @@ commands = oslo_debug_helper {posargs}
# D204: 1 blank line required after class docstring # D204: 1 blank line required after class docstring
# D209: Multi-line docstring closing quotes should be on a separate line # D209: Multi-line docstring closing quotes should be on a separate line
# D301: Use r""" if any backslashes in a docstring # D301: Use r""" if any backslashes in a docstring
# D400: First line should end with a period ignore = D100,D101,D102,D103,D104,D105,D200,D202,D209,D301,D204
ignore = D100,D101,D102,D103,D104,D105,D200,D202,D209,D301,D204,D400
show-source = True show-source = True
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common* exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*