mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Use Python 3 style super (#8777)
This is one of the things that newer versions of `pylint` complains about. * git grep -l super\( | xargs sed -i 's/super([^)]*)/super()/g' * fix spacing
This commit is contained in:
parent
459a254aea
commit
7f9857a81b
111 changed files with 263 additions and 263 deletions
|
|
@ -30,7 +30,7 @@ class Challenge(jose.TypedJSONObjectWithFields):
|
|||
@classmethod
|
||||
def from_json(cls, jobj):
|
||||
try:
|
||||
return super(Challenge, cls).from_json(jobj)
|
||||
return super().from_json(jobj)
|
||||
except jose.UnrecognizedTypeError as error:
|
||||
logger.debug(error)
|
||||
return UnrecognizedChallenge.from_json(jobj)
|
||||
|
|
@ -58,7 +58,7 @@ class UnrecognizedChallenge(Challenge):
|
|||
"""
|
||||
|
||||
def __init__(self, jobj):
|
||||
super(UnrecognizedChallenge, self).__init__()
|
||||
super().__init__()
|
||||
object.__setattr__(self, "jobj", jobj)
|
||||
|
||||
def to_partial_json(self):
|
||||
|
|
@ -141,7 +141,7 @@ class KeyAuthorizationChallengeResponse(ChallengeResponse):
|
|||
return True
|
||||
|
||||
def to_partial_json(self):
|
||||
jobj = super(KeyAuthorizationChallengeResponse, self).to_partial_json()
|
||||
jobj = super().to_partial_json()
|
||||
jobj.pop('keyAuthorization', None)
|
||||
return jobj
|
||||
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ class Client(ClientBase):
|
|||
if isinstance(directory, str):
|
||||
directory = messages.Directory.from_json(
|
||||
net.get(directory).json())
|
||||
super(Client, self).__init__(directory=directory,
|
||||
super().__init__(directory=directory,
|
||||
net=net, acme_version=1)
|
||||
|
||||
def register(self, new_reg=None):
|
||||
|
|
@ -577,7 +577,7 @@ class ClientV2(ClientBase):
|
|||
:param .messages.Directory directory: Directory Resource
|
||||
:param .ClientNetwork net: Client network.
|
||||
"""
|
||||
super(ClientV2, self).__init__(directory=directory,
|
||||
super().__init__(directory=directory,
|
||||
net=net, acme_version=2)
|
||||
|
||||
def new_account(self, new_account):
|
||||
|
|
@ -627,7 +627,7 @@ class ClientV2(ClientBase):
|
|||
"""
|
||||
# https://github.com/certbot/certbot/issues/6155
|
||||
new_regr = self._get_v2_account(regr)
|
||||
return super(ClientV2, self).update_registration(new_regr, update)
|
||||
return super().update_registration(new_regr, update)
|
||||
|
||||
def _get_v2_account(self, regr):
|
||||
self.net.account = None
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class NonceError(ClientError):
|
|||
class BadNonce(NonceError):
|
||||
"""Bad nonce error."""
|
||||
def __init__(self, nonce, error, *args):
|
||||
super(BadNonce, self).__init__(*args)
|
||||
super().__init__(*args)
|
||||
self.nonce = nonce
|
||||
self.error = error
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ class MissingNonce(NonceError):
|
|||
|
||||
"""
|
||||
def __init__(self, response, *args):
|
||||
super(MissingNonce, self).__init__(*args)
|
||||
super().__init__(*args)
|
||||
self.response = response
|
||||
|
||||
def __str__(self):
|
||||
|
|
@ -72,7 +72,7 @@ class PollError(ClientError):
|
|||
def __init__(self, exhausted, updated):
|
||||
self.exhausted = exhausted
|
||||
self.updated = updated
|
||||
super(PollError, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
@property
|
||||
def timeout(self):
|
||||
|
|
@ -90,7 +90,7 @@ class ValidationError(Error):
|
|||
"""
|
||||
def __init__(self, failed_authzrs):
|
||||
self.failed_authzrs = failed_authzrs
|
||||
super(ValidationError, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
|
||||
class TimeoutError(Error): # pylint: disable=redefined-builtin
|
||||
|
|
@ -106,7 +106,7 @@ class IssuanceError(Error):
|
|||
:param messages.Error error: The error provided by the server.
|
||||
"""
|
||||
self.error = error
|
||||
super(IssuanceError, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
|
||||
class ConflictError(ClientError):
|
||||
|
|
@ -119,7 +119,7 @@ class ConflictError(ClientError):
|
|||
"""
|
||||
def __init__(self, location):
|
||||
self.location = location
|
||||
super(ConflictError, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
|
||||
class WildcardUnsupportedError(Error):
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class Fixed(jose.Field):
|
|||
|
||||
def __init__(self, json_name, value):
|
||||
self.value = value
|
||||
super(Fixed, self).__init__(
|
||||
super().__init__(
|
||||
json_name=json_name, default=value, omitempty=False)
|
||||
|
||||
def decode(self, value):
|
||||
|
|
@ -53,7 +53,7 @@ class Resource(jose.Field):
|
|||
|
||||
def __init__(self, resource_type, *args, **kwargs):
|
||||
self.resource_type = resource_type
|
||||
super(Resource, self).__init__(
|
||||
super().__init__(
|
||||
'resource', default=resource_type, *args, **kwargs)
|
||||
|
||||
def decode(self, value):
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class JWS(jose.JWS):
|
|||
# Per ACME spec, jwk and kid are mutually exclusive, so only include a
|
||||
# jwk field if kid is not provided.
|
||||
include_jwk = kid is None
|
||||
return super(JWS, cls).sign(payload, key=key, alg=alg,
|
||||
return super().sign(payload, key=key, alg=alg,
|
||||
protect=frozenset(['nonce', 'url', 'kid', 'jwk', 'alg']),
|
||||
nonce=nonce, url=url, kid=kid,
|
||||
include_jwk=include_jwk)
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class _Constant(jose.JSONDeSerializable, Hashable): # type: ignore
|
|||
POSSIBLE_NAMES: Dict[str, '_Constant'] = NotImplemented
|
||||
|
||||
def __init__(self, name):
|
||||
super(_Constant, self).__init__()
|
||||
super().__init__()
|
||||
self.POSSIBLE_NAMES[name] = self # pylint: disable=unsupported-assignment-operation
|
||||
self.name = name
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ class Directory(jose.JSONDeSerializable):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
kwargs = {self._internal_name(k): v for k, v in kwargs.items()}
|
||||
super(Directory.Meta, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
@property
|
||||
def terms_of_service(self):
|
||||
|
|
@ -211,7 +211,7 @@ class Directory(jose.JSONDeSerializable):
|
|||
def __iter__(self):
|
||||
# When iterating over fields, use the external name 'terms_of_service' instead of
|
||||
# the internal '_terms_of_service'.
|
||||
for name in super(Directory.Meta, self).__iter__():
|
||||
for name in super().__iter__():
|
||||
yield name[1:] if name == '_terms_of_service' else name
|
||||
|
||||
def _internal_name(self, name):
|
||||
|
|
@ -357,7 +357,7 @@ class Registration(ResourceBody):
|
|||
if 'contact' in kwargs:
|
||||
# Avoid the __setattr__ used by jose.TypedJSONObjectWithFields
|
||||
object.__setattr__(self, '_add_contact', True)
|
||||
super(Registration, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def _filter_contact(self, prefix):
|
||||
return tuple(
|
||||
|
|
@ -383,12 +383,12 @@ class Registration(ResourceBody):
|
|||
|
||||
def to_partial_json(self):
|
||||
"""Modify josepy.JSONDeserializable.to_partial_json()"""
|
||||
jobj = super(Registration, self).to_partial_json()
|
||||
jobj = super().to_partial_json()
|
||||
return self._add_contact_if_appropriate(jobj)
|
||||
|
||||
def fields_to_partial_json(self):
|
||||
"""Modify josepy.JSONObjectWithFields.fields_to_partial_json()"""
|
||||
jobj = super(Registration, self).fields_to_partial_json()
|
||||
jobj = super().fields_to_partial_json()
|
||||
return self._add_contact_if_appropriate(jobj)
|
||||
|
||||
@property
|
||||
|
|
@ -460,19 +460,19 @@ class ChallengeBody(ResourceBody):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
kwargs = {self._internal_name(k): v for k, v in kwargs.items()}
|
||||
super(ChallengeBody, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def encode(self, name):
|
||||
return super(ChallengeBody, self).encode(self._internal_name(name))
|
||||
return super().encode(self._internal_name(name))
|
||||
|
||||
def to_partial_json(self):
|
||||
jobj = super(ChallengeBody, self).to_partial_json()
|
||||
jobj = super().to_partial_json()
|
||||
jobj.update(self.chall.to_partial_json())
|
||||
return jobj
|
||||
|
||||
@classmethod
|
||||
def fields_from_json(cls, jobj):
|
||||
jobj_fields = super(ChallengeBody, cls).fields_from_json(jobj)
|
||||
jobj_fields = super().fields_from_json(jobj)
|
||||
jobj_fields['chall'] = challenges.Challenge.from_json(jobj)
|
||||
return jobj_fields
|
||||
|
||||
|
|
@ -487,7 +487,7 @@ class ChallengeBody(ResourceBody):
|
|||
def __iter__(self):
|
||||
# When iterating over fields, use the external name 'uri' instead of
|
||||
# the internal '_uri'.
|
||||
for name in super(ChallengeBody, self).__iter__():
|
||||
for name in super().__iter__():
|
||||
yield name[1:] if name == '_uri' else name
|
||||
|
||||
def _internal_name(self, name):
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class VersionedLEACMEMixin:
|
|||
# Required for @property to operate properly. See comment above.
|
||||
object.__setattr__(self, key, value)
|
||||
else:
|
||||
super(VersionedLEACMEMixin, self).__setattr__(key, value) # pragma: no cover
|
||||
super().__setattr__(key, value) # pragma: no cover
|
||||
|
||||
|
||||
class ResourceMixin(VersionedLEACMEMixin):
|
||||
|
|
@ -30,12 +30,12 @@ class ResourceMixin(VersionedLEACMEMixin):
|
|||
"""
|
||||
def to_partial_json(self):
|
||||
"""See josepy.JSONDeserializable.to_partial_json()"""
|
||||
return _safe_jobj_compliance(super(ResourceMixin, self),
|
||||
return _safe_jobj_compliance(super(),
|
||||
'to_partial_json', 'resource')
|
||||
|
||||
def fields_to_partial_json(self):
|
||||
"""See josepy.JSONObjectWithFields.fields_to_partial_json()"""
|
||||
return _safe_jobj_compliance(super(ResourceMixin, self),
|
||||
return _safe_jobj_compliance(super(),
|
||||
'fields_to_partial_json', 'resource')
|
||||
|
||||
|
||||
|
|
@ -46,12 +46,12 @@ class TypeMixin(VersionedLEACMEMixin):
|
|||
"""
|
||||
def to_partial_json(self):
|
||||
"""See josepy.JSONDeserializable.to_partial_json()"""
|
||||
return _safe_jobj_compliance(super(TypeMixin, self),
|
||||
return _safe_jobj_compliance(super(),
|
||||
'to_partial_json', 'type')
|
||||
|
||||
def fields_to_partial_json(self):
|
||||
"""See josepy.JSONObjectWithFields.fields_to_partial_json()"""
|
||||
return _safe_jobj_compliance(super(TypeMixin, self),
|
||||
return _safe_jobj_compliance(super(),
|
||||
'fields_to_partial_json', 'type')
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class BackwardsCompatibleClientV2Test(ClientTestBase):
|
|||
"""Tests for acme.client.BackwardsCompatibleClientV2."""
|
||||
|
||||
def setUp(self):
|
||||
super(BackwardsCompatibleClientV2Test, self).setUp()
|
||||
super().setUp()
|
||||
# contains a loaded cert
|
||||
self.certr = messages.CertificateResource(
|
||||
body=messages_test.CERT)
|
||||
|
|
@ -319,7 +319,7 @@ class ClientTest(ClientTestBase):
|
|||
"""Tests for acme.client.Client."""
|
||||
|
||||
def setUp(self):
|
||||
super(ClientTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.directory = DIRECTORY_V1
|
||||
|
||||
|
|
@ -716,7 +716,7 @@ class ClientV2Test(ClientTestBase):
|
|||
"""Tests for acme.client.ClientV2."""
|
||||
|
||||
def setUp(self):
|
||||
super(ClientV2Test, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.directory = DIRECTORY_V2
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class ApacheParserNode(interfaces.ParserNode):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
ancestor, dirty, filepath, metadata = util.parsernode_kwargs(kwargs) # pylint: disable=unused-variable
|
||||
super(ApacheParserNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
self.ancestor = ancestor
|
||||
self.filepath = filepath
|
||||
self.dirty = dirty
|
||||
|
|
@ -39,7 +39,7 @@ class ApacheCommentNode(ApacheParserNode):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
comment, kwargs = util.commentnode_kwargs(kwargs) # pylint: disable=unused-variable
|
||||
super(ApacheCommentNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
self.comment = comment
|
||||
|
||||
def __eq__(self, other): # pragma: no cover
|
||||
|
|
@ -57,7 +57,7 @@ class ApacheDirectiveNode(ApacheParserNode):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
name, parameters, enabled, kwargs = util.directivenode_kwargs(kwargs)
|
||||
super(ApacheDirectiveNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
self.name = name
|
||||
self.parameters = parameters
|
||||
self.enabled = enabled
|
||||
|
|
@ -83,7 +83,7 @@ class ApacheBlockNode(ApacheDirectiveNode):
|
|||
""" apacheconfig implementation of BlockNode interface """
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(ApacheBlockNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
self.children: Tuple[ApacheParserNode, ...] = ()
|
||||
|
||||
def __eq__(self, other): # pragma: no cover
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class AugeasParserNode(interfaces.ParserNode):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
ancestor, dirty, filepath, metadata = util.parsernode_kwargs(kwargs) # pylint: disable=unused-variable
|
||||
super(AugeasParserNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
self.ancestor = ancestor
|
||||
self.filepath = filepath
|
||||
self.dirty = dirty
|
||||
|
|
@ -169,7 +169,7 @@ class AugeasCommentNode(AugeasParserNode):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
comment, kwargs = util.commentnode_kwargs(kwargs) # pylint: disable=unused-variable
|
||||
super(AugeasCommentNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
# self.comment = comment
|
||||
self.comment = comment
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ class AugeasDirectiveNode(AugeasParserNode):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
name, parameters, enabled, kwargs = util.directivenode_kwargs(kwargs)
|
||||
super(AugeasDirectiveNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
self.name = name
|
||||
self.enabled = enabled
|
||||
if parameters:
|
||||
|
|
@ -245,7 +245,7 @@ class AugeasBlockNode(AugeasDirectiveNode):
|
|||
""" Augeas implementation of BlockNode interface """
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(AugeasBlockNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
self.children = ()
|
||||
|
||||
def __eq__(self, other):
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ class ApacheConfigurator(common.Installer):
|
|||
version = kwargs.pop("version", None)
|
||||
use_parsernode = kwargs.pop("use_parsernode", False)
|
||||
openssl_version = kwargs.pop("openssl_version", None)
|
||||
super(ApacheConfigurator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
# Add name_server association dict
|
||||
self.assoc: Dict[str, obj.VirtualHost] = {}
|
||||
|
|
@ -410,7 +410,7 @@ class ApacheConfigurator(common.Installer):
|
|||
:raises .errors.PluginError: If unable to recover the configuration
|
||||
|
||||
"""
|
||||
super(ApacheConfigurator, self).recovery_routine()
|
||||
super().recovery_routine()
|
||||
# Reload configuration after these changes take effect if needed
|
||||
# ie. ApacheParser has been initialized.
|
||||
if hasattr(self, "parser"):
|
||||
|
|
@ -435,7 +435,7 @@ class ApacheConfigurator(common.Installer):
|
|||
the function is unable to correctly revert the configuration
|
||||
|
||||
"""
|
||||
super(ApacheConfigurator, self).rollback_checkpoints(rollback)
|
||||
super().rollback_checkpoints(rollback)
|
||||
self.parser.aug.load()
|
||||
|
||||
def _verify_exe_availability(self, exe):
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class ApacheHttp01(common.ChallengePerformer):
|
|||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ApacheHttp01, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.challenge_conf_pre = os.path.join(
|
||||
self.configurator.conf("challenge-location"),
|
||||
"le_http_01_challenge_pre.conf")
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ class CommentNode(ParserNode, metaclass=abc.ABCMeta):
|
|||
created or changed after the last save. Default: False.
|
||||
:type dirty: bool
|
||||
"""
|
||||
super(CommentNode, self).__init__(ancestor=kwargs['ancestor'],
|
||||
super().__init__(ancestor=kwargs['ancestor'],
|
||||
dirty=kwargs.get('dirty', False),
|
||||
filepath=kwargs['filepath'],
|
||||
metadata=kwargs.get('metadata', {})) # pragma: no cover
|
||||
|
|
@ -302,7 +302,7 @@ class DirectiveNode(ParserNode, metaclass=abc.ABCMeta):
|
|||
:type enabled: bool
|
||||
|
||||
"""
|
||||
super(DirectiveNode, self).__init__(ancestor=kwargs['ancestor'],
|
||||
super().__init__(ancestor=kwargs['ancestor'],
|
||||
dirty=kwargs.get('dirty', False),
|
||||
filepath=kwargs['filepath'],
|
||||
metadata=kwargs.get('metadata', {})) # pragma: no cover
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class Addr(common.Addr):
|
|||
def __hash__(self): # pylint: disable=useless-super-delegation
|
||||
# Python 3 requires explicit overridden for __hash__ if __eq__ or
|
||||
# __cmp__ is overridden. See https://bugs.python.org/issue2235
|
||||
return super(Addr, self).__hash__()
|
||||
return super().__hash__()
|
||||
|
||||
def _addr_less_specific(self, addr):
|
||||
"""Returns if addr.get_addr() is more specific than self.get_addr()."""
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class CentOSConfigurator(configurator.ApacheConfigurator):
|
|||
fedora = os_info[0].lower() == "fedora"
|
||||
|
||||
try:
|
||||
super(CentOSConfigurator, self).config_test()
|
||||
super().config_test()
|
||||
except errors.MisconfigurationError:
|
||||
if fedora:
|
||||
self._try_restart_fedora()
|
||||
|
|
@ -69,14 +69,14 @@ class CentOSConfigurator(configurator.ApacheConfigurator):
|
|||
raise errors.MisconfigurationError(str(err))
|
||||
|
||||
# Finish with actual config check to see if systemctl restart helped
|
||||
super(CentOSConfigurator, self).config_test()
|
||||
super().config_test()
|
||||
|
||||
def _prepare_options(self):
|
||||
"""
|
||||
Override the options dictionary initialization in order to support
|
||||
alternative restart cmd used in CentOS.
|
||||
"""
|
||||
super(CentOSConfigurator, self)._prepare_options()
|
||||
super()._prepare_options()
|
||||
cast(List[str], self.options["restart_cmd_alt"])[0] = self.option("ctl")
|
||||
|
||||
def get_parser(self):
|
||||
|
|
@ -91,7 +91,7 @@ class CentOSConfigurator(configurator.ApacheConfigurator):
|
|||
has "LoadModule ssl_module..." before parsing the VirtualHost configuration
|
||||
that was created by Certbot
|
||||
"""
|
||||
super(CentOSConfigurator, self)._deploy_cert(*args, **kwargs)
|
||||
super()._deploy_cert(*args, **kwargs)
|
||||
if self.version < (2, 4, 0):
|
||||
self._deploy_loadmodule_ssl_if_needed()
|
||||
|
||||
|
|
@ -169,12 +169,12 @@ class CentOSParser(parser.ApacheParser):
|
|||
def __init__(self, *args, **kwargs):
|
||||
# CentOS specific configuration file for Apache
|
||||
self.sysconfig_filep = "/etc/sysconfig/httpd"
|
||||
super(CentOSParser, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def update_runtime_variables(self):
|
||||
""" Override for update_runtime_variables for custom parsing """
|
||||
# Opportunistic, works if SELinux not enforced
|
||||
super(CentOSParser, self).update_runtime_variables()
|
||||
super().update_runtime_variables()
|
||||
self.parse_sysconfig_var()
|
||||
|
||||
def parse_sysconfig_var(self):
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class DebianConfigurator(configurator.ApacheConfigurator):
|
|||
if not os.path.isdir(os.path.dirname(enabled_path)):
|
||||
# For some reason, sites-enabled / sites-available do not exist
|
||||
# Call the parent method
|
||||
return super(DebianConfigurator, self).enable_site(vhost)
|
||||
return super().enable_site(vhost)
|
||||
self.reverter.register_file_creation(False, enabled_path)
|
||||
try:
|
||||
os.symlink(vhost.filep, enabled_path)
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class FedoraConfigurator(configurator.ApacheConfigurator):
|
|||
during the first (re)start of httpd.
|
||||
"""
|
||||
try:
|
||||
super(FedoraConfigurator, self).config_test()
|
||||
super().config_test()
|
||||
except errors.MisconfigurationError:
|
||||
self._try_restart_fedora()
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ class FedoraConfigurator(configurator.ApacheConfigurator):
|
|||
raise errors.MisconfigurationError(str(err))
|
||||
|
||||
# Finish with actual config check to see if systemctl restart helped
|
||||
super(FedoraConfigurator, self).config_test()
|
||||
super().config_test()
|
||||
|
||||
def _prepare_options(self):
|
||||
"""
|
||||
|
|
@ -71,7 +71,7 @@ class FedoraConfigurator(configurator.ApacheConfigurator):
|
|||
instead of httpd and so take advantages of this new bash script in newer versions
|
||||
of Fedora to restart httpd.
|
||||
"""
|
||||
super(FedoraConfigurator, self)._prepare_options()
|
||||
super()._prepare_options()
|
||||
cast(List[str], self.options["restart_cmd"])[0] = 'apachectl'
|
||||
cast(List[str], self.options["restart_cmd_alt"])[0] = 'apachectl'
|
||||
cast(List[str], self.options["conftest_cmd"])[0] = 'apachectl'
|
||||
|
|
@ -82,12 +82,12 @@ class FedoraParser(parser.ApacheParser):
|
|||
def __init__(self, *args, **kwargs):
|
||||
# Fedora 29+ specific configuration file for Apache
|
||||
self.sysconfig_filep = "/etc/sysconfig/httpd"
|
||||
super(FedoraParser, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def update_runtime_variables(self):
|
||||
""" Override for update_runtime_variables for custom parsing """
|
||||
# Opportunistic, works if SELinux not enforced
|
||||
super(FedoraParser, self).update_runtime_variables()
|
||||
super().update_runtime_variables()
|
||||
self._parse_sysconfig_var()
|
||||
|
||||
def _parse_sysconfig_var(self):
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class GentooConfigurator(configurator.ApacheConfigurator):
|
|||
Override the options dictionary initialization in order to support
|
||||
alternative restart cmd used in Gentoo.
|
||||
"""
|
||||
super(GentooConfigurator, self)._prepare_options()
|
||||
super()._prepare_options()
|
||||
cast(List[str], self.options["restart_cmd_alt"])[0] = self.option("ctl")
|
||||
|
||||
def get_parser(self):
|
||||
|
|
@ -53,7 +53,7 @@ class GentooParser(parser.ApacheParser):
|
|||
def __init__(self, *args, **kwargs):
|
||||
# Gentoo specific configuration file for Apache2
|
||||
self.apacheconfig_filep = "/etc/conf.d/apache2"
|
||||
super(GentooParser, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def update_runtime_variables(self):
|
||||
""" Override for update_runtime_variables for custom parsing """
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class AugeasParserNodeTest(util.ApacheTest): # pylint: disable=too-many-public-
|
|||
"""Test AugeasParserNode using available test configurations"""
|
||||
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(AugeasParserNodeTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
with mock.patch("certbot_apache._internal.configurator.ApacheConfigurator.get_parsernode_root") as mock_parsernode:
|
||||
mock_parsernode.side_effect = _get_augeasnode_mock(
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class AutoHSTSTest(util.ApacheTest):
|
|||
# pylint: disable=protected-access
|
||||
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(AutoHSTSTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir)
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ class CentOS6Tests(util.ApacheTest):
|
|||
test_dir = "centos6_apache/apache"
|
||||
config_root = "centos6_apache/apache/httpd"
|
||||
vhost_root = "centos6_apache/apache/httpd/conf.d"
|
||||
super(CentOS6Tests, self).setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
super().setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir,
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ class FedoraRestartTest(util.ApacheTest):
|
|||
test_dir = "centos7_apache/apache"
|
||||
config_root = "centos7_apache/apache/httpd"
|
||||
vhost_root = "centos7_apache/apache/httpd/conf.d"
|
||||
super(FedoraRestartTest, self).setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
super().setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir,
|
||||
os_info="fedora_old")
|
||||
|
|
@ -96,9 +96,9 @@ class MultipleVhostsTestCentOS(util.ApacheTest):
|
|||
test_dir = "centos7_apache/apache"
|
||||
config_root = "centos7_apache/apache/httpd"
|
||||
vhost_root = "centos7_apache/apache/httpd/conf.d"
|
||||
super(MultipleVhostsTestCentOS, self).setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
super().setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class ComplexParserTest(util.ParserTest):
|
|||
"""Apache Parser Test."""
|
||||
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(ComplexParserTest, self).setUp(
|
||||
super().setUp(
|
||||
"complex_parsing", "complex_parsing")
|
||||
|
||||
self.setup_variables()
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class ConfiguratorReverterTest(util.ApacheTest):
|
|||
|
||||
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(ConfiguratorReverterTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir)
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class MultipleVhostsTest(util.ApacheTest):
|
|||
"""Test two standard well-configured HTTP vhosts."""
|
||||
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(MultipleVhostsTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir)
|
||||
|
|
@ -1477,9 +1477,9 @@ class AugeasVhostsTest(util.ApacheTest):
|
|||
td = "debian_apache_2_4/augeas_vhosts"
|
||||
cr = "debian_apache_2_4/augeas_vhosts/apache2"
|
||||
vr = "debian_apache_2_4/augeas_vhosts/apache2/sites-available"
|
||||
super(AugeasVhostsTest, self).setUp(test_dir=td,
|
||||
config_root=cr,
|
||||
vhost_root=vr)
|
||||
super().setUp(test_dir=td,
|
||||
config_root=cr,
|
||||
vhost_root=vr)
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir,
|
||||
|
|
@ -1556,9 +1556,9 @@ class MultiVhostsTest(util.ApacheTest):
|
|||
td = "debian_apache_2_4/multi_vhosts"
|
||||
cr = "debian_apache_2_4/multi_vhosts/apache2"
|
||||
vr = "debian_apache_2_4/multi_vhosts/apache2/sites-available"
|
||||
super(MultiVhostsTest, self).setUp(test_dir=td,
|
||||
config_root=cr,
|
||||
vhost_root=vr)
|
||||
super().setUp(test_dir=td,
|
||||
config_root=cr,
|
||||
vhost_root=vr)
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path,
|
||||
|
|
@ -1661,7 +1661,7 @@ class InstallSslOptionsConfTest(util.ApacheTest):
|
|||
"""Test that the options-ssl-nginx.conf file is installed and updated properly."""
|
||||
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(InstallSslOptionsConfTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class MultipleVhostsTestDebian(util.ApacheTest):
|
|||
_multiprocess_can_split_ = True
|
||||
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(MultipleVhostsTestDebian, self).setUp()
|
||||
super().setUp()
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir,
|
||||
os_info="debian")
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ class FedoraRestartTest(util.ApacheTest):
|
|||
test_dir = "centos7_apache/apache"
|
||||
config_root = "centos7_apache/apache/httpd"
|
||||
vhost_root = "centos7_apache/apache/httpd/conf.d"
|
||||
super(FedoraRestartTest, self).setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
super().setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir,
|
||||
os_info="fedora")
|
||||
|
|
@ -90,9 +90,9 @@ class MultipleVhostsTestFedora(util.ApacheTest):
|
|||
test_dir = "centos7_apache/apache"
|
||||
config_root = "centos7_apache/apache/httpd"
|
||||
vhost_root = "centos7_apache/apache/httpd/conf.d"
|
||||
super(MultipleVhostsTestFedora, self).setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
super().setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir, self.work_dir,
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ class MultipleVhostsTestGentoo(util.ApacheTest):
|
|||
test_dir = "gentoo_apache/apache"
|
||||
config_root = "gentoo_apache/apache/apache2"
|
||||
vhost_root = "gentoo_apache/apache/apache2/vhosts.d"
|
||||
super(MultipleVhostsTestGentoo, self).setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
super().setUp(test_dir=test_dir,
|
||||
config_root=config_root,
|
||||
vhost_root=vhost_root)
|
||||
|
||||
# pylint: disable=line-too-long
|
||||
with mock.patch("certbot_apache._internal.override_gentoo.GentooParser.update_runtime_variables"):
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class ApacheHttp01Test(util.ApacheTest):
|
|||
"""Test for certbot_apache._internal.http_01.ApacheHttp01."""
|
||||
|
||||
def setUp(self, *args, **kwargs): # pylint: disable=arguments-differ
|
||||
super(ApacheHttp01Test, self).setUp(*args, **kwargs)
|
||||
super().setUp(*args, **kwargs)
|
||||
|
||||
self.account_key = self.rsa512jwk
|
||||
self.achalls: List[achallenges.KeyAuthorizationAnnotatedChallenge] = []
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ class BasicParserTest(util.ParserTest):
|
|||
"""Apache Parser Test."""
|
||||
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(BasicParserTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree(self.temp_dir)
|
||||
|
|
@ -332,7 +332,7 @@ class BasicParserTest(util.ParserTest):
|
|||
|
||||
class ParserInitTest(util.ApacheTest):
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(ParserInitTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree(self.temp_dir)
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class ConfiguratorParserNodeTest(util.ApacheTest): # pylint: disable=too-many-p
|
|||
"""Test AugeasParserNode using available test configurations"""
|
||||
|
||||
def setUp(self): # pylint: disable=arguments-differ
|
||||
super(ConfiguratorParserNodeTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config = util.get_apache_configurator(
|
||||
self.config_path, self.vhost_path, self.config_dir,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class DummyParserNode(interfaces.ParserNode):
|
|||
self.dirty = dirty
|
||||
self.filepath = filepath
|
||||
self.metadata = metadata
|
||||
super(DummyParserNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def save(self, msg): # pragma: no cover
|
||||
"""Save"""
|
||||
|
|
@ -38,7 +38,7 @@ class DummyCommentNode(DummyParserNode):
|
|||
"""
|
||||
comment, kwargs = util.commentnode_kwargs(kwargs)
|
||||
self.comment = comment
|
||||
super(DummyCommentNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
|
||||
class DummyDirectiveNode(DummyParserNode):
|
||||
|
|
@ -54,7 +54,7 @@ class DummyDirectiveNode(DummyParserNode):
|
|||
self.parameters = parameters
|
||||
self.enabled = enabled
|
||||
|
||||
super(DummyDirectiveNode, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
def set_parameters(self, parameters): # pragma: no cover
|
||||
"""Set parameters"""
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class ParserTest(ApacheTest):
|
|||
def setUp(self, test_dir="debian_apache_2_4/multiple_vhosts",
|
||||
config_root="debian_apache_2_4/multiple_vhosts/apache2",
|
||||
vhost_root="debian_apache_2_4/multiple_vhosts/apache2/sites-available"):
|
||||
super(ParserTest, self).setUp(test_dir, config_root, vhost_root)
|
||||
super().setUp(test_dir, config_root, vhost_root)
|
||||
|
||||
zope.component.provideUtility(display_util.FileDisplay(sys.stdout,
|
||||
False))
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from certbot_integration_tests.utils import misc
|
|||
class IntegrationTestsContext(certbot_context.IntegrationTestsContext):
|
||||
"""General fixture describing a certbot-nginx integration tests context"""
|
||||
def __init__(self, request):
|
||||
super(IntegrationTestsContext, self).__init__(request)
|
||||
super().__init__(request)
|
||||
|
||||
self.nginx_root = os.path.join(self.workspace, 'nginx')
|
||||
os.mkdir(self.nginx_root)
|
||||
|
|
@ -29,7 +29,7 @@ class IntegrationTestsContext(certbot_context.IntegrationTestsContext):
|
|||
|
||||
def cleanup(self):
|
||||
self._stop_nginx()
|
||||
super(IntegrationTestsContext, self).cleanup()
|
||||
super().cleanup()
|
||||
|
||||
def certbot_test_nginx(self, args):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from certbot_integration_tests.utils import certbot_call
|
|||
class IntegrationTestsContext(certbot_context.IntegrationTestsContext):
|
||||
"""Integration test context for certbot-dns-rfc2136"""
|
||||
def __init__(self, request):
|
||||
super(IntegrationTestsContext, self).__init__(request)
|
||||
super().__init__(request)
|
||||
|
||||
self.request = request
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class Proxy(configurators_common.Proxy):
|
|||
|
||||
def __init__(self, args):
|
||||
"""Initializes the plugin with the given command line args"""
|
||||
super(Proxy, self).__init__(args)
|
||||
super().__init__(args)
|
||||
self.le_config.apache_le_vhost_ext = "-le-ssl.conf"
|
||||
|
||||
self.modules = self.server_root = self.test_conf = self.version = None
|
||||
|
|
@ -34,7 +34,7 @@ class Proxy(configurators_common.Proxy):
|
|||
|
||||
def load_config(self):
|
||||
"""Loads the next configuration for the plugin to test"""
|
||||
config = super(Proxy, self).load_config()
|
||||
config = super().load_config()
|
||||
self._all_names, self._test_names = _get_names(config)
|
||||
|
||||
server_root = _get_server_root(config)
|
||||
|
|
@ -65,7 +65,7 @@ class Proxy(configurators_common.Proxy):
|
|||
|
||||
def cleanup_from_tests(self):
|
||||
"""Performs any necessary cleanup from running plugin tests"""
|
||||
super(Proxy, self).cleanup_from_tests()
|
||||
super().cleanup_from_tests()
|
||||
mock.patch.stopall()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class Proxy(configurators_common.Proxy):
|
|||
|
||||
def load_config(self):
|
||||
"""Loads the next configuration for the plugin to test"""
|
||||
config = super(Proxy, self).load_config()
|
||||
config = super().load_config()
|
||||
self._all_names, self._test_names = _get_names(config)
|
||||
|
||||
server_root = _get_server_root(config)
|
||||
|
|
|
|||
|
|
@ -31,12 +31,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 120
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add)
|
||||
super().add_parser_arguments(add)
|
||||
add('credentials', help='Cloudflare credentials INI file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class AuthenticatorTest(test_util.TempDirTestCase, dns_test_common.BaseAuthentic
|
|||
def setUp(self):
|
||||
from certbot_dns_cloudflare._internal.dns_cloudflare import Authenticator
|
||||
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
path = os.path.join(self.tempdir, 'file.ini')
|
||||
dns_test_common.write({"cloudflare_email": EMAIL, "cloudflare_api_key": API_KEY}, path)
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 60
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=30)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=30)
|
||||
add('credentials', help='CloudXNS credentials INI file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
@ -71,7 +71,7 @@ class _CloudXNSLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
"""
|
||||
|
||||
def __init__(self, api_key, secret_key, ttl):
|
||||
super(_CloudXNSLexiconClient, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
config = dns_common_lexicon.build_lexicon_config('cloudxns', {
|
||||
'ttl': ttl,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
|
|||
dns_test_common_lexicon.BaseLexiconAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot_dns_cloudxns._internal.dns_cloudxns import Authenticator
|
||||
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 30
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add)
|
||||
super().add_parser_arguments(add)
|
||||
add('credentials', help='DigitalOcean credentials INI file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class AuthenticatorTest(test_util.TempDirTestCase, dns_test_common.BaseAuthentic
|
|||
def setUp(self):
|
||||
from certbot_dns_digitalocean._internal.dns_digitalocean import Authenticator
|
||||
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
path = os.path.join(self.tempdir, 'file.ini')
|
||||
dns_test_common.write({"digitalocean_token": TOKEN}, path)
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 60
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=30)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=30)
|
||||
add('credentials', help='DNSimple credentials INI file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
@ -67,7 +67,7 @@ class _DNSimpleLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
"""
|
||||
|
||||
def __init__(self, token, ttl):
|
||||
super(_DNSimpleLexiconClient, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
config = dns_common_lexicon.build_lexicon_config('dnssimple', {
|
||||
'ttl': ttl,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
|
|||
dns_test_common_lexicon.BaseLexiconAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot_dns_dnsimple._internal.dns_dnsimple import Authenticator
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 60
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=60)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=60)
|
||||
add('credentials', help='DNS Made Easy credentials INI file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
@ -73,7 +73,7 @@ class _DNSMadeEasyLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
"""
|
||||
|
||||
def __init__(self, api_key, secret_key, ttl):
|
||||
super(_DNSMadeEasyLexiconClient, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
config = dns_common_lexicon.build_lexicon_config('dnsmadeeasy', {
|
||||
'ttl': ttl,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
|
|||
dns_test_common_lexicon.BaseLexiconAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot_dns_dnsmadeeasy._internal.dns_dnsmadeeasy import Authenticator
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 60
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=30)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=30)
|
||||
add('credentials', help='Gehirn Infrastructure Service credentials file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
@ -75,7 +75,7 @@ class _GehirnLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
"""
|
||||
|
||||
def __init__(self, api_token, api_secret, ttl):
|
||||
super(_GehirnLexiconClient, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
config = dns_common_lexicon.build_lexicon_config('gehirn', {
|
||||
'ttl': ttl,
|
||||
|
|
@ -89,4 +89,4 @@ class _GehirnLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
def _handle_http_error(self, e, domain_name):
|
||||
if domain_name in str(e) and (str(e).startswith('404 Client Error: Not Found for url:')):
|
||||
return None # Expected errors when zone name guess is wrong
|
||||
return super(_GehirnLexiconClient, self)._handle_http_error(e, domain_name)
|
||||
return super()._handle_http_error(e, domain_name)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
|
|||
dns_test_common_lexicon.BaseLexiconAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot_dns_gehirn._internal.dns_gehirn import Authenticator
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=60)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=60)
|
||||
add('credentials',
|
||||
help=('Path to Google Cloud DNS service account JSON file. (See {0} for' +
|
||||
'information about creating a service account and {1} for information about the' +
|
||||
|
|
|
|||
|
|
@ -26,14 +26,14 @@ PROJECT_ID = "test-test-1"
|
|||
class AuthenticatorTest(test_util.TempDirTestCase, dns_test_common.BaseAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot_dns_google._internal.dns_google import Authenticator
|
||||
|
||||
path = os.path.join(self.tempdir, 'file.json')
|
||||
open(path, "wb").close()
|
||||
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config = mock.MagicMock(google_credentials=path,
|
||||
google_propagation_seconds=0) # don't wait during tests
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
description = 'Obtain certificates using a DNS TXT record (if you are using Linode for DNS).'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=120)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=120)
|
||||
add('credentials', help='Linode credentials INI file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
@ -85,7 +85,7 @@ class _LinodeLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
"""
|
||||
|
||||
def __init__(self, api_key, api_version):
|
||||
super(_LinodeLexiconClient, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
self.api_version = api_version
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
|
|||
dns_test_common_lexicon.BaseLexiconAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
path = os.path.join(self.tempdir, 'file.ini')
|
||||
dns_test_common.write({"linode_key": TOKEN}, path)
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 60
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=30)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=30)
|
||||
add('credentials', help='LuaDNS credentials INI file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
@ -70,7 +70,7 @@ class _LuaDNSLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
"""
|
||||
|
||||
def __init__(self, email, token, ttl):
|
||||
super(_LuaDNSLexiconClient, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
config = dns_common_lexicon.build_lexicon_config('luadns', {
|
||||
'ttl': ttl,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
|
|||
dns_test_common_lexicon.BaseLexiconAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot_dns_luadns._internal.dns_luadns import Authenticator
|
||||
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 60
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=30)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=30)
|
||||
add('credentials', help='NS1 credentials file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
@ -67,7 +67,7 @@ class _NS1LexiconClient(dns_common_lexicon.LexiconClient):
|
|||
"""
|
||||
|
||||
def __init__(self, api_key, ttl):
|
||||
super(_NS1LexiconClient, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
config = dns_common_lexicon.build_lexicon_config('nsone', {
|
||||
'ttl': ttl,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
|
|||
dns_test_common_lexicon.BaseLexiconAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot_dns_nsone._internal.dns_nsone import Authenticator
|
||||
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 60
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=30)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=30)
|
||||
add('credentials', help='OVH credentials INI file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
@ -79,7 +79,7 @@ class _OVHLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
"""
|
||||
|
||||
def __init__(self, endpoint, application_key, application_secret, consumer_key, ttl):
|
||||
super(_OVHLexiconClient, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
config = dns_common_lexicon.build_lexicon_config('ovh', {
|
||||
'ttl': ttl,
|
||||
|
|
@ -106,4 +106,4 @@ class _OVHLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
if domain_name in str(e) and str(e).endswith('not found'):
|
||||
return
|
||||
|
||||
super(_OVHLexiconClient, self)._handle_general_error(e, domain_name)
|
||||
super()._handle_general_error(e, domain_name)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
|
|||
dns_test_common_lexicon.BaseLexiconAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot_dns_ovh._internal.dns_ovh import Authenticator
|
||||
|
||||
|
|
|
|||
|
|
@ -45,12 +45,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 120
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(add, default_propagation_seconds=60)
|
||||
super().add_parser_arguments(add, default_propagation_seconds=60)
|
||||
add('credentials', help='RFC 2136 credentials INI file.')
|
||||
|
||||
def more_info(self): # pylint: disable=missing-function-docstring
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class AuthenticatorTest(test_util.TempDirTestCase, dns_test_common.BaseAuthentic
|
|||
def setUp(self):
|
||||
from certbot_dns_rfc2136._internal.dns_rfc2136 import Authenticator
|
||||
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
path = os.path.join(self.tempdir, 'file.ini')
|
||||
dns_test_common.write(VALID_CONFIG, path)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 10
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.r53 = boto3.client("route53")
|
||||
self._resource_records: DefaultDict[str, List[Dict[str, str]]] = collections.defaultdict(list)
|
||||
|
||||
|
|
|
|||
|
|
@ -18,4 +18,4 @@ class Authenticator(dns_route53.Authenticator):
|
|||
def __init__(self, *args, **kwargs):
|
||||
warnings.warn("The 'authenticator' module was renamed 'dns_route53'",
|
||||
DeprecationWarning)
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class AuthenticatorTest(unittest.TestCase, dns_test_common.BaseAuthenticatorTest
|
|||
def setUp(self):
|
||||
from certbot_dns_route53._internal.dns_route53 import Authenticator
|
||||
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config = mock.MagicMock()
|
||||
|
||||
|
|
|
|||
|
|
@ -29,12 +29,12 @@ class Authenticator(dns_common.DNSAuthenticator):
|
|||
ttl = 60
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.credentials: Optional[CredentialsConfiguration] = None
|
||||
|
||||
@classmethod
|
||||
def add_parser_arguments(cls, add): # pylint: disable=arguments-differ
|
||||
super(Authenticator, cls).add_parser_arguments(
|
||||
super().add_parser_arguments(
|
||||
add, default_propagation_seconds=90)
|
||||
add('credentials', help='Sakura Cloud credentials file.')
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ class _SakuraCloudLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
"""
|
||||
|
||||
def __init__(self, api_token, api_secret, ttl):
|
||||
super(_SakuraCloudLexiconClient, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
config = dns_common_lexicon.build_lexicon_config('sakuracloud', {
|
||||
'ttl': ttl,
|
||||
|
|
@ -92,4 +92,4 @@ class _SakuraCloudLexiconClient(dns_common_lexicon.LexiconClient):
|
|||
def _handle_http_error(self, e, domain_name):
|
||||
if domain_name in str(e) and (str(e).startswith('404 Client Error: Not Found for url:')):
|
||||
return None # Expected errors when zone name guess is wrong
|
||||
return super(_SakuraCloudLexiconClient, self)._handle_http_error(e, domain_name)
|
||||
return super()._handle_http_error(e, domain_name)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class AuthenticatorTest(test_util.TempDirTestCase,
|
|||
dns_test_common_lexicon.BaseLexiconAuthenticatorTest):
|
||||
|
||||
def setUp(self):
|
||||
super(AuthenticatorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot_dns_sakuracloud._internal.dns_sakuracloud import Authenticator
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class NginxConfigurator(common.Installer):
|
|||
"""
|
||||
version = kwargs.pop("version", None)
|
||||
openssl_version = kwargs.pop("openssl_version", None)
|
||||
super(NginxConfigurator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
# Files to save
|
||||
self.save_notes = ""
|
||||
|
|
@ -1110,7 +1110,7 @@ class NginxConfigurator(common.Installer):
|
|||
:raises .errors.PluginError: If unable to recover the configuration
|
||||
|
||||
"""
|
||||
super(NginxConfigurator, self).recovery_routine()
|
||||
super().recovery_routine()
|
||||
self.new_vhost = None
|
||||
self.parser.load()
|
||||
|
||||
|
|
@ -1133,7 +1133,7 @@ class NginxConfigurator(common.Installer):
|
|||
the function is unable to correctly revert the configuration
|
||||
|
||||
"""
|
||||
super(NginxConfigurator, self).rollback_checkpoints(rollback)
|
||||
super().rollback_checkpoints(rollback)
|
||||
self.new_vhost = None
|
||||
self.parser.load()
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class NginxHttp01(common.ChallengePerformer):
|
|||
"""
|
||||
|
||||
def __init__(self, configurator):
|
||||
super(NginxHttp01, self).__init__(configurator)
|
||||
super().__init__(configurator)
|
||||
self.challenge_conf = os.path.join(
|
||||
configurator.config.config_dir, "le_http_01_cert_challenge.conf")
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class Addr(common.Addr):
|
|||
CANONICAL_UNSPECIFIED_ADDRESS = UNSPECIFIED_IPV4_ADDRESSES[0]
|
||||
|
||||
def __init__(self, host, port, ssl, default, ipv6, ipv6only):
|
||||
super(Addr, self).__init__((host, port))
|
||||
super().__init__((host, port))
|
||||
self.ssl = ssl
|
||||
self.default = default
|
||||
self.ipv6 = ipv6
|
||||
|
|
@ -120,7 +120,7 @@ class Addr(common.Addr):
|
|||
def __hash__(self): # pylint: disable=useless-super-delegation
|
||||
# Python 3 requires explicit overridden for __hash__
|
||||
# See certbot-apache/certbot_apache/_internal/obj.py for more information
|
||||
return super(Addr, self).__hash__()
|
||||
return super().__hash__()
|
||||
|
||||
def super_eq(self, other):
|
||||
"""Check ip/port equality, with IPv6 support.
|
||||
|
|
@ -132,7 +132,7 @@ class Addr(common.Addr):
|
|||
self.tup[1]), self.ipv6) == \
|
||||
common.Addr((other.CANONICAL_UNSPECIFIED_ADDRESS,
|
||||
other.tup[1]), other.ipv6)
|
||||
return super(Addr, self).__eq__(other)
|
||||
return super().__eq__(other)
|
||||
|
||||
def __eq__(self, other):
|
||||
if isinstance(other, self.__class__):
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class Statements(Parsable):
|
|||
precede any more statements.
|
||||
"""
|
||||
def __init__(self, parent=None):
|
||||
super(Statements, self).__init__(parent)
|
||||
super().__init__(parent)
|
||||
self._trailing_whitespace = None
|
||||
|
||||
# ======== Begin overridden functions
|
||||
|
|
@ -167,7 +167,7 @@ class Statements(Parsable):
|
|||
def dump(self, include_spaces=False):
|
||||
""" Dumps this object by first dumping each statement, then appending its
|
||||
trailing whitespace (if `include_spaces` is set) """
|
||||
data = super(Statements, self).dump(include_spaces)
|
||||
data = super().dump(include_spaces)
|
||||
if include_spaces and self._trailing_whitespace is not None:
|
||||
return data + [self._trailing_whitespace]
|
||||
return data
|
||||
|
|
@ -271,7 +271,7 @@ class Block(Parsable):
|
|||
contents = [["\n ", "content", " ", "1"], ["\n ", "content", " ", "2"], "\n"]
|
||||
"""
|
||||
def __init__(self, parent=None):
|
||||
super(Block, self).__init__(parent)
|
||||
super().__init__(parent)
|
||||
self.names: Sentence = None
|
||||
self.contents: Block = None
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class NginxConfiguratorTest(util.NginxTest):
|
|||
|
||||
|
||||
def setUp(self):
|
||||
super(NginxConfiguratorTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config = self.get_nginx_configurator(
|
||||
self.config_path, self.config_dir, self.work_dir, self.logs_dir)
|
||||
|
|
@ -954,7 +954,7 @@ class InstallSslOptionsConfTest(util.NginxTest):
|
|||
"""Test that the options-ssl-nginx.conf file is installed and updated properly."""
|
||||
|
||||
def setUp(self):
|
||||
super(InstallSslOptionsConfTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config = self.get_nginx_configurator(
|
||||
self.config_path, self.config_dir, self.work_dir, self.logs_dir)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class SelectVhostMultiTest(util.NginxTest):
|
|||
"""Tests for certbot_nginx._internal.display_ops.select_vhost_multiple."""
|
||||
|
||||
def setUp(self):
|
||||
super(SelectVhostMultiTest, self).setUp()
|
||||
super().setUp()
|
||||
nparser = parser.NginxParser(self.config_path)
|
||||
self.vhosts = nparser.get_vhosts()
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class HttpPerformTest(util.NginxTest):
|
|||
]
|
||||
|
||||
def setUp(self):
|
||||
super(HttpPerformTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
config = self.get_nginx_configurator(
|
||||
self.config_path, self.config_dir, self.work_dir, self.logs_dir)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from certbot_nginx._internal import nginxparser
|
|||
class NginxTest(test_util.ConfigTestCase):
|
||||
|
||||
def setUp(self):
|
||||
super(NginxTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.configuration = self.config
|
||||
self.config = None
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class CaseInsensitiveList(list):
|
|||
through the `helpful` wrapper. It is necessary due to special handling of
|
||||
command line arguments by `set_by_cli` in which the `type_func` is not applied."""
|
||||
def __contains__(self, element):
|
||||
return super(CaseInsensitiveList, self).__contains__(element.lower())
|
||||
return super().__contains__(element.lower())
|
||||
|
||||
|
||||
def _user_agent_comment_type(value):
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ class ColoredStreamHandler(logging.StreamHandler):
|
|||
|
||||
"""
|
||||
def __init__(self, stream=None):
|
||||
super(ColoredStreamHandler, self).__init__(stream)
|
||||
super().__init__(stream)
|
||||
self.colored = (sys.stderr.isatty() if stream is None else
|
||||
stream.isatty())
|
||||
self.red_level = logging.WARNING
|
||||
|
|
@ -185,7 +185,7 @@ class ColoredStreamHandler(logging.StreamHandler):
|
|||
:rtype: str
|
||||
|
||||
"""
|
||||
out = super(ColoredStreamHandler, self).format(record)
|
||||
out = super().format(record)
|
||||
if self.colored and record.levelno >= self.red_level:
|
||||
return ''.join((util.ANSI_SGR_RED, out, util.ANSI_SGR_RESET))
|
||||
return out
|
||||
|
|
@ -200,14 +200,14 @@ class MemoryHandler(logging.handlers.MemoryHandler):
|
|||
"""
|
||||
def __init__(self, target=None, capacity=10000):
|
||||
# capacity doesn't matter because should_flush() is overridden
|
||||
super(MemoryHandler, self).__init__(capacity, target=target)
|
||||
super().__init__(capacity, target=target)
|
||||
|
||||
def close(self):
|
||||
"""Close the memory handler, but don't set the target to None."""
|
||||
# This allows the logging module which may only have a weak
|
||||
# reference to the target handler to properly flush and close it.
|
||||
target = getattr(self, 'target')
|
||||
super(MemoryHandler, self).close()
|
||||
super().close()
|
||||
self.target = target
|
||||
|
||||
def flush(self, force=False): # pylint: disable=arguments-differ
|
||||
|
|
@ -221,7 +221,7 @@ class MemoryHandler(logging.handlers.MemoryHandler):
|
|||
# This method allows flush() calls in logging.shutdown to be a
|
||||
# noop so we can control when this handler is flushed.
|
||||
if force:
|
||||
super(MemoryHandler, self).flush()
|
||||
super().flush()
|
||||
|
||||
def shouldFlush(self, record):
|
||||
"""Should the buffer be automatically flushed?
|
||||
|
|
@ -249,7 +249,7 @@ class TempHandler(logging.StreamHandler):
|
|||
self._workdir = tempfile.mkdtemp()
|
||||
self.path = os.path.join(self._workdir, 'log')
|
||||
stream = util.safe_open(self.path, mode='w', chmod=0o600)
|
||||
super(TempHandler, self).__init__(stream)
|
||||
super().__init__(stream)
|
||||
self._delete = True
|
||||
|
||||
def emit(self, record):
|
||||
|
|
@ -259,7 +259,7 @@ class TempHandler(logging.StreamHandler):
|
|||
|
||||
"""
|
||||
self._delete = False
|
||||
super(TempHandler, self).emit(record)
|
||||
super().emit(record)
|
||||
|
||||
def close(self):
|
||||
"""Close the handler and the temporary log file.
|
||||
|
|
@ -275,7 +275,7 @@ class TempHandler(logging.StreamHandler):
|
|||
if self._delete:
|
||||
shutil.rmtree(self._workdir)
|
||||
self._delete = False
|
||||
super(TempHandler, self).close()
|
||||
super().close()
|
||||
finally:
|
||||
self.release()
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ permitted by DNS standards.)
|
|||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.reverter = reverter.Reverter(self.config)
|
||||
self.reverter.recovery_routine()
|
||||
self.env: Dict[achallenges.KeyAuthorizationAnnotatedChallenge, Dict[str, str]] = {}
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ class Authenticator(common.Plugin):
|
|||
description = "Spin up a temporary webserver"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.served: ServedType = collections.defaultdict(set)
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ to serve all files under specified web root ({0})."""
|
|||
return [challenges.HTTP01]
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Authenticator, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.full_roots: Dict[str, str] = {}
|
||||
self.performed: DefaultDict[str, Set[AnnotatedChallenge]] = collections.defaultdict(set)
|
||||
# stack of dirs successfully created by this authenticator
|
||||
|
|
@ -250,7 +250,7 @@ class _WebrootPathAction(argparse.Action):
|
|||
"""Action class for parsing webroot_path."""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(_WebrootPathAction, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self._domain_before_webroot = False
|
||||
|
||||
def __call__(self, parser, namespace, webroot_path, option_string=None):
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ def prepare_env(cli_args: List[str]) -> List[str]:
|
|||
|
||||
class _SnapdConnection(HTTPConnection):
|
||||
def __init__(self):
|
||||
super(_SnapdConnection, self).__init__("localhost")
|
||||
super().__init__("localhost")
|
||||
self.sock = None
|
||||
|
||||
def connect(self):
|
||||
|
|
@ -90,7 +90,7 @@ class _SnapdConnection(HTTPConnection):
|
|||
|
||||
class _SnapdConnectionPool(HTTPConnectionPool):
|
||||
def __init__(self):
|
||||
super(_SnapdConnectionPool, self).__init__("localhost")
|
||||
super().__init__("localhost")
|
||||
|
||||
def _new_conn(self):
|
||||
return _SnapdConnection()
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class FileDisplay:
|
|||
# see https://github.com/certbot/certbot/issues/3915
|
||||
|
||||
def __init__(self, outfile, force_interactive):
|
||||
super(FileDisplay, self).__init__()
|
||||
super().__init__()
|
||||
self.outfile = outfile
|
||||
self.force_interactive = force_interactive
|
||||
self.skipped_interaction = False
|
||||
|
|
@ -481,7 +481,7 @@ class NoninteractiveDisplay:
|
|||
"""An iDisplay implementation that never asks for interactive user input"""
|
||||
|
||||
def __init__(self, outfile, *unused_args, **unused_kwargs):
|
||||
super(NoninteractiveDisplay, self).__init__()
|
||||
super().__init__()
|
||||
self.outfile = outfile
|
||||
|
||||
def _interaction_fail(self, message, cli_flag, extra=""):
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class FailedChallenges(AuthorizationError):
|
|||
def __init__(self, failed_achalls):
|
||||
assert failed_achalls
|
||||
self.failed_achalls = failed_achalls
|
||||
super(FailedChallenges, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
def __str__(self):
|
||||
return "Failed authorization procedure. {0}".format(
|
||||
|
|
@ -95,7 +95,7 @@ class StandaloneBindError(Error):
|
|||
"""Standalone plugin bind error."""
|
||||
|
||||
def __init__(self, socket_error, port):
|
||||
super(StandaloneBindError, self).__init__(
|
||||
super().__init__(
|
||||
"Problem binding to port {0}: {1}".format(port, socket_error))
|
||||
self.socket_error = socket_error
|
||||
self.port = port
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class Installer(Plugin):
|
|||
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Installer, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
self.storage = PluginStorage(self.config, self.name)
|
||||
self.reverter = reverter.Reverter(self.config)
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class DNSAuthenticator(common.Plugin):
|
|||
"""Base class for DNS Authenticators"""
|
||||
|
||||
def __init__(self, config, name):
|
||||
super(DNSAuthenticator, self).__init__(config, name)
|
||||
super().__init__(config, name)
|
||||
|
||||
self._attempt_cleanup = False
|
||||
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ class TempDirTestCase(unittest.TestCase):
|
|||
class ConfigTestCase(TempDirTestCase):
|
||||
"""Test class which sets up a NamespaceConfig object."""
|
||||
def setUp(self):
|
||||
super(ConfigTestCase, self).setUp()
|
||||
super().setUp()
|
||||
self.config = configuration.NamespaceConfig(
|
||||
mock.MagicMock(**constants.CLI_DEFAULTS)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class AccountFileStorageTest(test_util.ConfigTestCase):
|
|||
"""Tests for certbot._internal.account.AccountFileStorage."""
|
||||
|
||||
def setUp(self):
|
||||
super(AccountFileStorageTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
from certbot._internal.account import AccountFileStorage
|
||||
self.storage = AccountFileStorage(self.config)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class BaseCertManagerTest(test_util.ConfigTestCase):
|
|||
"""Base class for setting up Cert Manager tests.
|
||||
"""
|
||||
def setUp(self):
|
||||
super(BaseCertManagerTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config.quiet = False
|
||||
filesystem.makedirs(self.config.renewal_configs_dir)
|
||||
|
|
@ -396,7 +396,7 @@ class RenameLineageTest(BaseCertManagerTest):
|
|||
"""Tests for certbot._internal.cert_manager.rename_lineage"""
|
||||
|
||||
def setUp(self):
|
||||
super(RenameLineageTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config.certname = "example.org"
|
||||
self.config.new_certname = "after"
|
||||
|
||||
|
|
@ -483,7 +483,7 @@ class DuplicativeCertsTest(storage_test.BaseRenewableCertTest):
|
|||
"""Test to avoid duplicate lineages."""
|
||||
|
||||
def setUp(self):
|
||||
super(DuplicativeCertsTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config_file.write()
|
||||
self._write_out_ex_kinds()
|
||||
|
||||
|
|
@ -521,7 +521,7 @@ class CertPathToLineageTest(storage_test.BaseRenewableCertTest):
|
|||
"""Tests for certbot._internal.cert_manager.cert_path_to_lineage"""
|
||||
|
||||
def setUp(self):
|
||||
super(CertPathToLineageTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config_file.write()
|
||||
self._write_out_ex_kinds()
|
||||
self.fullchain = os.path.join(self.config.config_dir, 'live', 'example.org',
|
||||
|
|
@ -581,7 +581,7 @@ class MatchAndCheckOverlaps(storage_test.BaseRenewableCertTest):
|
|||
archive dirs."""
|
||||
# A test with real overlapping archive dirs can be found in tests/boulder_integration.sh
|
||||
def setUp(self):
|
||||
super(MatchAndCheckOverlaps, self).setUp()
|
||||
super().setUp()
|
||||
self.config_file.write()
|
||||
self._write_out_ex_kinds()
|
||||
self.fullchain = os.path.join(self.config.config_dir, 'live', 'example.org',
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class RegisterTest(test_util.ConfigTestCase):
|
|||
"""Tests for certbot._internal.client.register."""
|
||||
|
||||
def setUp(self):
|
||||
super(RegisterTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config.rsa_key_size = 1024
|
||||
self.config.register_unsafely_without_email = False
|
||||
self.config.email = "alias@example.com"
|
||||
|
|
@ -217,7 +217,7 @@ class ClientTestCommon(test_util.ConfigTestCase):
|
|||
"""Common base class for certbot._internal.client.Client tests."""
|
||||
|
||||
def setUp(self):
|
||||
super(ClientTestCommon, self).setUp()
|
||||
super().setUp()
|
||||
self.config.no_verify_ssl = False
|
||||
self.config.allow_subset_of_names = False
|
||||
|
||||
|
|
@ -236,7 +236,7 @@ class ClientTest(ClientTestCommon):
|
|||
"""Tests for certbot._internal.client.Client."""
|
||||
|
||||
def setUp(self):
|
||||
super(ClientTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config.allow_subset_of_names = False
|
||||
self.config.dry_run = False
|
||||
|
|
@ -582,7 +582,7 @@ class EnhanceConfigTest(ClientTestCommon):
|
|||
"""Tests for certbot._internal.client.Client.enhance_config."""
|
||||
|
||||
def setUp(self):
|
||||
super(EnhanceConfigTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config.hsts = False
|
||||
self.config.redirect = False
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ ADMINS_SID = 'S-1-5-32-544'
|
|||
class WindowsChmodTests(TempDirTestCase):
|
||||
"""Unit tests for Windows chmod function in filesystem module"""
|
||||
def setUp(self):
|
||||
super(WindowsChmodTests, self).setUp()
|
||||
super().setUp()
|
||||
self.probe_path = _create_probe(self.tempdir)
|
||||
|
||||
def test_symlink_resolution(self):
|
||||
|
|
@ -203,7 +203,7 @@ class UmaskTest(TempDirTestCase):
|
|||
|
||||
class ComputePrivateKeyModeTest(TempDirTestCase):
|
||||
def setUp(self):
|
||||
super(ComputePrivateKeyModeTest, self).setUp()
|
||||
super().setUp()
|
||||
self.probe_path = _create_probe(self.tempdir)
|
||||
|
||||
def test_compute_private_key_mode(self):
|
||||
|
|
@ -351,7 +351,7 @@ class MakedirsTests(test_util.TempDirTestCase):
|
|||
class CopyOwnershipAndModeTest(test_util.TempDirTestCase):
|
||||
"""Tests about copy_ownership_and_apply_mode, copy_ownership_and_mode and has_same_ownership"""
|
||||
def setUp(self):
|
||||
super(CopyOwnershipAndModeTest, self).setUp()
|
||||
super().setUp()
|
||||
self.probe_path = _create_probe(self.tempdir)
|
||||
|
||||
@unittest.skipIf(POSIX_MODE, reason='Test specific to Windows security')
|
||||
|
|
@ -424,7 +424,7 @@ class CopyOwnershipAndModeTest(test_util.TempDirTestCase):
|
|||
class CheckPermissionsTest(test_util.TempDirTestCase):
|
||||
"""Tests relative to functions that check modes."""
|
||||
def setUp(self):
|
||||
super(CheckPermissionsTest, self).setUp()
|
||||
super().setUp()
|
||||
self.probe_path = _create_probe(self.tempdir)
|
||||
|
||||
def test_check_mode(self):
|
||||
|
|
@ -506,7 +506,7 @@ class OsReplaceTest(test_util.TempDirTestCase):
|
|||
class RealpathTest(test_util.TempDirTestCase):
|
||||
"""Tests for realpath method"""
|
||||
def setUp(self):
|
||||
super(RealpathTest, self).setUp()
|
||||
super().setUp()
|
||||
self.probe_path = _create_probe(self.tempdir)
|
||||
|
||||
def test_symlink_resolution(self):
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class NamespaceConfigTest(test_util.ConfigTestCase):
|
|||
"""Tests for certbot._internal.configuration.NamespaceConfig."""
|
||||
|
||||
def setUp(self):
|
||||
super(NamespaceConfigTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config.foo = 'bar' # pylint: disable=blacklisted-name
|
||||
self.config.server = 'https://acme-server.org:443/new'
|
||||
self.config.https_port = 1234
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ CERT_ALT_ISSUER = test_util.load_vector('cert_intermediate_2.pem')
|
|||
class InitSaveKeyTest(test_util.TempDirTestCase):
|
||||
"""Tests for certbot.crypto_util.init_save_key."""
|
||||
def setUp(self):
|
||||
super(InitSaveKeyTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.workdir = os.path.join(self.tempdir, 'workdir')
|
||||
filesystem.mkdir(self.workdir, mode=0o700)
|
||||
|
|
@ -46,7 +46,7 @@ class InitSaveKeyTest(test_util.TempDirTestCase):
|
|||
mock.Mock(strict_permissions=True), interfaces.IConfig)
|
||||
|
||||
def tearDown(self):
|
||||
super(InitSaveKeyTest, self).tearDown()
|
||||
super().tearDown()
|
||||
|
||||
logging.disable(logging.NOTSET)
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ class InitSaveCSRTest(test_util.TempDirTestCase):
|
|||
"""Tests for certbot.crypto_util.init_save_csr."""
|
||||
|
||||
def setUp(self):
|
||||
super(InitSaveCSRTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
zope.component.provideUtility(
|
||||
mock.Mock(strict_permissions=True), interfaces.IConfig)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class CompleterTest(test_util.TempDirTestCase):
|
|||
"""Test certbot._internal.display.completer.Completer."""
|
||||
|
||||
def setUp(self):
|
||||
super(CompleterTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
# directories must end with os.sep for completer to
|
||||
# search inside the directory for possible completions
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class GetEmailTest(unittest.TestCase):
|
|||
class ChooseAccountTest(test_util.TempDirTestCase):
|
||||
"""Tests for certbot.display.ops.choose_account."""
|
||||
def setUp(self):
|
||||
super(ChooseAccountTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
zope.component.provideUtility(display_util.FileDisplay(sys.stdout,
|
||||
False))
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class FileOutputDisplayTest(unittest.TestCase):
|
|||
|
||||
"""
|
||||
def setUp(self):
|
||||
super(FileOutputDisplayTest, self).setUp()
|
||||
super().setUp()
|
||||
self.mock_stdout = mock.MagicMock()
|
||||
self.displayer = display_util.FileDisplay(self.mock_stdout, False)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ _KEY = josepy.JWKRSA.load(test_util.load_vector("rsa512_key.pem"))
|
|||
class SubscriptionTest(test_util.ConfigTestCase):
|
||||
"""Abstract class for subscription tests."""
|
||||
def setUp(self):
|
||||
super(SubscriptionTest, self).setUp()
|
||||
super().setUp()
|
||||
self.account = account.Account(
|
||||
regr=messages.RegistrationResource(
|
||||
uri=None, body=messages.Registration(),
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ class ExitHandlerTest(ErrorHandlerTest):
|
|||
|
||||
def setUp(self):
|
||||
from certbot._internal import error_handler
|
||||
super(ExitHandlerTest, self).setUp()
|
||||
super().setUp()
|
||||
self.handler = error_handler.ExitHandler(self.init_func,
|
||||
*self.init_args,
|
||||
**self.init_kwargs)
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class PreHookTest(HookTest):
|
|||
return pre_hook(*args, **kwargs)
|
||||
|
||||
def setUp(self):
|
||||
super(PreHookTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config.pre_hook = "foo"
|
||||
|
||||
filesystem.makedirs(self.config.renewal_pre_hooks_dir)
|
||||
|
|
@ -106,7 +106,7 @@ class PreHookTest(HookTest):
|
|||
def tearDown(self):
|
||||
# Reset this value so it's unmodified for future tests
|
||||
self._reset_pre_hook_already()
|
||||
super(PreHookTest, self).tearDown()
|
||||
super().tearDown()
|
||||
|
||||
def _reset_pre_hook_already(self):
|
||||
from certbot._internal.hooks import executed_pre_hooks
|
||||
|
|
@ -171,7 +171,7 @@ class PostHookTest(HookTest):
|
|||
return post_hook(*args, **kwargs)
|
||||
|
||||
def setUp(self):
|
||||
super(PostHookTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
self.config.post_hook = "bar"
|
||||
filesystem.makedirs(self.config.renewal_post_hooks_dir)
|
||||
|
|
@ -184,7 +184,7 @@ class PostHookTest(HookTest):
|
|||
def tearDown(self):
|
||||
# Reset this value so it's unmodified for future tests
|
||||
self._reset_post_hook_eventually()
|
||||
super(PostHookTest, self).tearDown()
|
||||
super().tearDown()
|
||||
|
||||
def _reset_post_hook_eventually(self):
|
||||
from certbot._internal.hooks import post_hooks
|
||||
|
|
@ -266,7 +266,7 @@ class RunSavedPostHooksTest(HookTest):
|
|||
return self._call_with_mock_execute(*args, **kwargs)
|
||||
|
||||
def setUp(self):
|
||||
super(RunSavedPostHooksTest, self).setUp()
|
||||
super().setUp()
|
||||
self.eventually: List[str] = []
|
||||
|
||||
def test_empty(self):
|
||||
|
|
@ -319,7 +319,7 @@ class RenewalHookTest(HookTest):
|
|||
return mock_execute
|
||||
|
||||
def setUp(self):
|
||||
super(RenewalHookTest, self).setUp()
|
||||
super().setUp()
|
||||
self.vars_to_clear = set(
|
||||
var for var in ("RENEWED_DOMAINS", "RENEWED_LINEAGE",)
|
||||
if var not in os.environ)
|
||||
|
|
@ -327,7 +327,7 @@ class RenewalHookTest(HookTest):
|
|||
def tearDown(self):
|
||||
for var in self.vars_to_clear:
|
||||
os.environ.pop(var, None)
|
||||
super(RenewalHookTest, self).tearDown()
|
||||
super().tearDown()
|
||||
|
||||
|
||||
class DeployHookTest(RenewalHookTest):
|
||||
|
|
@ -373,7 +373,7 @@ class RenewHookTest(RenewalHookTest):
|
|||
return renew_hook(*args, **kwargs)
|
||||
|
||||
def setUp(self):
|
||||
super(RenewHookTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config.renew_hook = "foo"
|
||||
|
||||
filesystem.makedirs(self.config.renewal_deploy_hooks_dir)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class LockFileTest(test_util.TempDirTestCase):
|
|||
return LockFile(*args, **kwargs)
|
||||
|
||||
def setUp(self):
|
||||
super(LockFileTest, self).setUp()
|
||||
super().setUp()
|
||||
self.lock_path = os.path.join(self.tempdir, 'test.lock')
|
||||
|
||||
def test_acquire_without_deletion(self):
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class PostArgParseSetupTest(test_util.ConfigTestCase):
|
|||
return post_arg_parse_setup(*args, **kwargs)
|
||||
|
||||
def setUp(self):
|
||||
super(PostArgParseSetupTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config.debug = False
|
||||
self.config.max_log_backups = 1000
|
||||
self.config.quiet = False
|
||||
|
|
@ -91,7 +91,7 @@ class PostArgParseSetupTest(test_util.ConfigTestCase):
|
|||
self.stream_handler.close()
|
||||
self.temp_handler.close()
|
||||
self.devnull.close()
|
||||
super(PostArgParseSetupTest, self).tearDown()
|
||||
super().tearDown()
|
||||
|
||||
def test_common(self):
|
||||
with mock.patch('certbot._internal.log.logging.getLogger') as mock_get_logger:
|
||||
|
|
@ -136,7 +136,7 @@ class SetupLogFileHandlerTest(test_util.ConfigTestCase):
|
|||
return setup_log_file_handler(*args, **kwargs)
|
||||
|
||||
def setUp(self):
|
||||
super(SetupLogFileHandlerTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config.max_log_backups = 42
|
||||
|
||||
@mock.patch('certbot._internal.main.logging.handlers.RotatingFileHandler')
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ class RunTest(test_util.ConfigTestCase):
|
|||
"""Tests for certbot._internal.main.run."""
|
||||
|
||||
def setUp(self):
|
||||
super(RunTest, self).setUp()
|
||||
super().setUp()
|
||||
self.domain = 'example.org'
|
||||
patches = [
|
||||
mock.patch('certbot._internal.main._get_and_save_cert'),
|
||||
|
|
@ -283,7 +283,7 @@ class RevokeTest(test_util.TempDirTestCase):
|
|||
"""Tests for certbot._internal.main.revoke."""
|
||||
|
||||
def setUp(self):
|
||||
super(RevokeTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
shutil.copy(CERT_PATH, self.tempdir)
|
||||
self.tmp_cert_path = os.path.abspath(os.path.join(self.tempdir, 'cert_512.pem'))
|
||||
|
|
@ -512,7 +512,7 @@ class DetermineAccountTest(test_util.ConfigTestCase):
|
|||
"""Tests for certbot._internal.main._determine_account."""
|
||||
|
||||
def setUp(self):
|
||||
super(DetermineAccountTest, self).setUp()
|
||||
super().setUp()
|
||||
self.config.account = None
|
||||
self.config.email = None
|
||||
self.config.register_unsafely_without_email = False
|
||||
|
|
@ -584,7 +584,7 @@ class MainTest(test_util.ConfigTestCase):
|
|||
"""Tests for different commands."""
|
||||
|
||||
def setUp(self):
|
||||
super(MainTest, self).setUp()
|
||||
super().setUp()
|
||||
|
||||
filesystem.mkdir(self.config.logs_dir)
|
||||
self.standard_args = ['--config-dir', self.config.config_dir,
|
||||
|
|
@ -597,7 +597,7 @@ class MainTest(test_util.ConfigTestCase):
|
|||
# Reset globals in cli
|
||||
reload_module(cli)
|
||||
|
||||
super(MainTest, self).tearDown()
|
||||
super().tearDown()
|
||||
|
||||
def _call(self, args, stdout=None, mockisfile=False):
|
||||
"""Run the cli with output streams, actual client and optionally
|
||||
|
|
@ -1576,7 +1576,7 @@ class EnhanceTest(test_util.ConfigTestCase):
|
|||
"""Tests for certbot._internal.main.enhance."""
|
||||
|
||||
def setUp(self):
|
||||
super(EnhanceTest, self).setUp()
|
||||
super().setUp()
|
||||
self.get_utility_patch = test_util.patch_get_utility()
|
||||
self.mock_get_utility = self.get_utility_patch.start()
|
||||
self.mockinstaller = mock.MagicMock(spec=enhancements.AutoHSTSEnhancement)
|
||||
|
|
@ -1720,7 +1720,7 @@ class InstallTest(test_util.ConfigTestCase):
|
|||
"""Tests for certbot._internal.main.install."""
|
||||
|
||||
def setUp(self):
|
||||
super(InstallTest, self).setUp()
|
||||
super().setUp()
|
||||
self.mockinstaller = mock.MagicMock(spec=enhancements.AutoHSTSEnhancement)
|
||||
|
||||
@mock.patch('certbot._internal.main.plug_sel.record_chosen_plugins')
|
||||
|
|
@ -1765,7 +1765,7 @@ class UpdateAccountTest(test_util.ConfigTestCase):
|
|||
for patch in patches.values():
|
||||
self.addCleanup(patch.stop)
|
||||
|
||||
return super(UpdateAccountTest, self).setUp()
|
||||
return super().setUp()
|
||||
|
||||
def _call(self, args):
|
||||
with mock.patch('certbot._internal.main.sys.stdout'), \
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue