Fixing D105 PEP257
Currently tox ignores D105. D105: Missing docstring in magic method. This change removes it and make keystoneclient docstring compliant with it. Change-Id: I34dfc164891880425f542f8f8aa3426ec8640c96
This commit is contained in:
parent
4c180e691f
commit
01500be7fb
@ -460,6 +460,7 @@ class Resource(object):
|
||||
self._loaded = loaded
|
||||
|
||||
def __repr__(self):
|
||||
"""Return string representation of resource attributes."""
|
||||
reprkeys = sorted(k
|
||||
for k in self.__dict__.keys()
|
||||
if k[0] != '_' and k != 'manager')
|
||||
@ -485,6 +486,7 @@ class Resource(object):
|
||||
pass
|
||||
|
||||
def __getattr__(self, k):
|
||||
"""Checking attrbiute existence."""
|
||||
if k not in self.__dict__:
|
||||
# NOTE(bcwaldon): disallow lazy-loading if already loaded once
|
||||
if not self.is_loaded():
|
||||
@ -513,6 +515,7 @@ class Resource(object):
|
||||
{'x_request_id': self.manager.client.last_request_id})
|
||||
|
||||
def __eq__(self, other):
|
||||
"""Define equality for resources."""
|
||||
if not isinstance(other, Resource):
|
||||
return NotImplemented
|
||||
# two resources of different types are not equal
|
||||
|
@ -868,6 +868,7 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
|
||||
deprecated_adapter_variables = {'region_name': None}
|
||||
|
||||
def __getattr__(self, name):
|
||||
"""Fetch deprecated session variables."""
|
||||
try:
|
||||
var_name = self.deprecated_session_variables[name]
|
||||
except KeyError: # nosec(cjschaef): try adapter variable or raise
|
||||
@ -894,6 +895,7 @@ class HTTPClient(baseclient.Client, base.BaseAuthPlugin):
|
||||
raise AttributeError(_("Unknown Attribute: %s") % name)
|
||||
|
||||
def __setattr__(self, name, val):
|
||||
"""Assign value to deprecated seesion variables."""
|
||||
try:
|
||||
var_name = self.deprecated_session_variables[name]
|
||||
except KeyError: # nosec(cjschaef): try adapter variable or call
|
||||
|
@ -37,6 +37,7 @@ class MockPlugin(base.BaseAuthPlugin):
|
||||
self._data = kwargs
|
||||
|
||||
def __getitem__(self, key):
|
||||
"""Get the data of the key."""
|
||||
return self._data[key]
|
||||
|
||||
def get_token(self, *args, **kwargs):
|
||||
|
@ -18,6 +18,7 @@ from keystoneclient import base
|
||||
|
||||
class EC2(base.Resource):
|
||||
def __repr__(self):
|
||||
"""Return string representation of EC2 resource information."""
|
||||
return "<EC2 %s>" % self._info
|
||||
|
||||
def delete(self):
|
||||
|
@ -20,6 +20,7 @@ class Endpoint(base.Resource):
|
||||
"""Represents a Keystone endpoint."""
|
||||
|
||||
def __repr__(self):
|
||||
"""Return string representation of endpoint resource information."""
|
||||
return "<Endpoint %s>" % self._info
|
||||
|
||||
|
||||
|
@ -17,6 +17,7 @@ class Extension(base.Resource):
|
||||
"""Represents an Identity API extension."""
|
||||
|
||||
def __repr__(self):
|
||||
"""Return string representation of extension resource information."""
|
||||
return "<Extension %s>" % self._info
|
||||
|
||||
|
||||
|
@ -21,6 +21,7 @@ class Role(base.Resource):
|
||||
"""Represents a Keystone role."""
|
||||
|
||||
def __repr__(self):
|
||||
"""Return string representation of role resource information."""
|
||||
return "<Role %s>" % self._info
|
||||
|
||||
def delete(self):
|
||||
|
@ -21,6 +21,7 @@ class Service(base.Resource):
|
||||
"""Represents a Keystone service."""
|
||||
|
||||
def __repr__(self):
|
||||
"""Return string representation of service resource information."""
|
||||
return "<Service %s>" % self._info
|
||||
|
||||
|
||||
|
@ -34,6 +34,7 @@ class Tenant(base.Resource):
|
||||
"""
|
||||
|
||||
def __repr__(self):
|
||||
"""Return string representation of tenant resource information."""
|
||||
return "<Tenant %s>" % self._info
|
||||
|
||||
def delete(self):
|
||||
|
@ -21,6 +21,7 @@ from keystoneclient.i18n import _
|
||||
|
||||
class Token(base.Resource):
|
||||
def __repr__(self):
|
||||
"""Return string representation of resource information."""
|
||||
return "<Token %s>" % self._info
|
||||
|
||||
@property
|
||||
|
@ -23,6 +23,7 @@ class User(base.Resource):
|
||||
"""Represents a Keystone user."""
|
||||
|
||||
def __repr__(self):
|
||||
"""Return string representation of user resource information."""
|
||||
return "<User %s>" % self._info
|
||||
|
||||
def delete(self):
|
||||
|
@ -58,6 +58,7 @@ class OAuthManagerOptionalImportProxy(object):
|
||||
"""
|
||||
|
||||
def __getattribute__(self, name):
|
||||
"""Return error when name is related to oauthlib and not exist."""
|
||||
if name in ('access_tokens', 'consumers', 'request_tokens'):
|
||||
raise NotImplementedError(
|
||||
_('To use %r oauthlib must be installed') % name)
|
||||
|
@ -16,6 +16,7 @@ from keystoneclient import base
|
||||
class EC2(base.Resource):
|
||||
|
||||
def __repr__(self):
|
||||
"""Return string representation of EC2 resource information."""
|
||||
return "<EC2 %s>" % self._info
|
||||
|
||||
|
||||
|
3
tox.ini
3
tox.ini
@ -45,8 +45,7 @@ passenv = OS_*
|
||||
# D102: Missing docstring in public method
|
||||
# D103: Missing docstring in public function
|
||||
# D104: Missing docstring in public package
|
||||
# D105: Missing docstring in magic method
|
||||
ignore = D100,D101,D102,D103,D104,D105
|
||||
ignore = D100,D101,D102,D103,D104
|
||||
show-source = True
|
||||
exclude = .venv,.tox,dist,doc,*egg,build,*openstack/common*
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user