mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
Fix Custodia pylint issues
See: https://pagure.io/freeipa/issue/8882 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
parent
a4631b7f3f
commit
e1abfe0fb7
@ -62,7 +62,7 @@ class HTTPUnixAdapter(HTTPAdapter):
|
||||
DEFAULT_HEADERS = {'Content-Type': 'application/json'}
|
||||
|
||||
|
||||
class CustodiaHTTPClient(object):
|
||||
class CustodiaHTTPClient:
|
||||
timeout = None # seconds (float)
|
||||
|
||||
def __init__(self, url):
|
||||
|
@ -42,7 +42,7 @@ class SimplePathAuthz(HTTPAuthorizer):
|
||||
if path == '/':
|
||||
path = ''
|
||||
else:
|
||||
path, _ = os.path.split(path)
|
||||
path, _head = os.path.split(path)
|
||||
|
||||
self.logger.debug('No path in %s matched %s', self.paths, reqpath)
|
||||
return None
|
||||
|
@ -492,7 +492,7 @@ class HTTPRequestHandler(BaseHTTPRequestHandler):
|
||||
raise HTTPError(404)
|
||||
|
||||
|
||||
class HTTPServer(object):
|
||||
class HTTPServer:
|
||||
handler = HTTPRequestHandler
|
||||
|
||||
def __init__(self, srvurl, config):
|
||||
|
@ -158,7 +158,7 @@ AUDIT_MESSAGES = [
|
||||
]
|
||||
|
||||
|
||||
class AuditLog(object):
|
||||
class AuditLog:
|
||||
def __init__(self, logger):
|
||||
self.logger = logger
|
||||
|
||||
|
@ -39,7 +39,7 @@ class UnallowedMessage(Exception):
|
||||
super(UnallowedMessage, self).__init__(message)
|
||||
|
||||
|
||||
class MessageHandler(object):
|
||||
class MessageHandler:
|
||||
|
||||
def __init__(self, request):
|
||||
self.req = request
|
||||
|
@ -14,7 +14,7 @@ key_types = {'simple': SimpleKey,
|
||||
'kem': KEMHandler}
|
||||
|
||||
|
||||
class Validator(object):
|
||||
class Validator:
|
||||
"""Validates incoming messages."""
|
||||
|
||||
def __init__(self, allowed=None):
|
||||
|
@ -200,7 +200,7 @@ class KEMHandler(MessageHandler):
|
||||
return {'type': 'kem', 'value': value}
|
||||
|
||||
|
||||
class KEMClient(object):
|
||||
class KEMClient:
|
||||
|
||||
def __init__(self, server_keys, client_keys):
|
||||
self.server_keys = server_keys
|
||||
|
@ -20,14 +20,14 @@ from .log import CustodiaLoggingAdapter, auditlog, getLogger
|
||||
logger = getLogger(__name__)
|
||||
|
||||
|
||||
class _Required(object):
|
||||
class _Required:
|
||||
__slots__ = ()
|
||||
|
||||
def __repr__(self):
|
||||
return 'REQUIRED'
|
||||
|
||||
|
||||
class INHERIT_GLOBAL(object): # noqa: N801
|
||||
class INHERIT_GLOBAL: # noqa: N801
|
||||
__slots__ = ('default',)
|
||||
|
||||
def __init__(self, default):
|
||||
@ -68,7 +68,7 @@ class CSStoreDenied(CustodiaException):
|
||||
pass
|
||||
|
||||
|
||||
class OptionHandler(object):
|
||||
class OptionHandler:
|
||||
"""Handler and parser for plugin options
|
||||
"""
|
||||
def __init__(self, parser, section):
|
||||
@ -108,7 +108,7 @@ class OptionHandler(object):
|
||||
|
||||
def check_surplus(self):
|
||||
surplus = []
|
||||
for name, _ in self.parser.items(self.section):
|
||||
for name, _value in self.parser.items(self.section):
|
||||
if (name not in self.seen and not
|
||||
self.parser.has_option(configparser.DEFAULTSECT, name)):
|
||||
surplus.append(name)
|
||||
@ -190,7 +190,7 @@ class OptionHandler(object):
|
||||
return json.loads(value)
|
||||
|
||||
|
||||
class PluginOption(object):
|
||||
class PluginOption:
|
||||
"""Plugin option
|
||||
|
||||
code::
|
||||
@ -293,7 +293,7 @@ class CustodiaPluginMeta(abc.ABCMeta):
|
||||
|
||||
|
||||
@six.add_metaclass(CustodiaPluginMeta)
|
||||
class CustodiaPlugin(object):
|
||||
class CustodiaPlugin:
|
||||
"""Abstract base class for all Custodia plugins
|
||||
"""
|
||||
_options = ()
|
||||
|
@ -114,10 +114,9 @@ class Secrets(HTTPConsumer):
|
||||
for t in types:
|
||||
if t.strip() == 'application/json':
|
||||
binary = False
|
||||
break
|
||||
elif t.strip() == 'application/octet-stream':
|
||||
binary = True
|
||||
if binary is True:
|
||||
if binary:
|
||||
response['headers'][
|
||||
'Content-Type'] = 'application/octet-stream'
|
||||
response['output'] = b64decode(reply['value'])
|
||||
|
@ -11,7 +11,7 @@ from ipaserver.custodia.compat import configparser
|
||||
from ipaserver.custodia.compat import url_escape
|
||||
|
||||
|
||||
class CustodiaConfig(object):
|
||||
class CustodiaConfig:
|
||||
CONFIG_SPECIALS = ['authenticators', 'authorizers', 'consumers', 'stores']
|
||||
|
||||
DEFAULT_PATHS = [
|
||||
@ -86,7 +86,7 @@ class CustodiaConfig(object):
|
||||
return configfiles
|
||||
|
||||
def makedirs(self):
|
||||
for name, _ in self.DEFAULT_PATHS:
|
||||
for name, _path in self.DEFAULT_PATHS:
|
||||
path = self.parser.get(u'DEFAULT', name)
|
||||
parent = os.path.dirname(path)
|
||||
# create parents according to umask
|
||||
|
Loading…
Reference in New Issue
Block a user