mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Use super() now that we require python3, less error prone
This commit is contained in:
@@ -40,7 +40,7 @@ class AxfrBaseSource(BaseSource):
|
||||
)
|
||||
|
||||
def __init__(self, id):
|
||||
super(AxfrBaseSource, self).__init__(id)
|
||||
super().__init__(id)
|
||||
|
||||
def _data_for_multiple(self, _type, records):
|
||||
return {
|
||||
@@ -186,9 +186,7 @@ class AxfrSourceException(Exception):
|
||||
|
||||
class AxfrSourceZoneTransferFailed(AxfrSourceException):
|
||||
def __init__(self):
|
||||
super(AxfrSourceZoneTransferFailed, self).__init__(
|
||||
'Unable to Perform Zone Transfer'
|
||||
)
|
||||
super().__init__('Unable to Perform Zone Transfer')
|
||||
|
||||
|
||||
class AxfrSource(AxfrBaseSource):
|
||||
@@ -204,7 +202,7 @@ class AxfrSource(AxfrBaseSource):
|
||||
def __init__(self, id, master):
|
||||
self.log = logging.getLogger(f'AxfrSource[{id}]')
|
||||
self.log.debug('__init__: id=%s, master=%s', id, master)
|
||||
super(AxfrSource, self).__init__(id)
|
||||
super().__init__(id)
|
||||
self.master = master
|
||||
|
||||
def zone_records(self, zone):
|
||||
@@ -238,12 +236,12 @@ class ZoneFileSourceException(Exception):
|
||||
|
||||
class ZoneFileSourceNotFound(ZoneFileSourceException):
|
||||
def __init__(self):
|
||||
super(ZoneFileSourceNotFound, self).__init__('Zone file not found')
|
||||
super().__init__('Zone file not found')
|
||||
|
||||
|
||||
class ZoneFileSourceLoadFailure(ZoneFileSourceException):
|
||||
def __init__(self, error):
|
||||
super(ZoneFileSourceLoadFailure, self).__init__(str(error))
|
||||
super().__init__(str(error))
|
||||
|
||||
|
||||
class ZoneFileSource(AxfrBaseSource):
|
||||
@@ -275,7 +273,7 @@ class ZoneFileSource(AxfrBaseSource):
|
||||
file_extension,
|
||||
check_origin,
|
||||
)
|
||||
super(ZoneFileSource, self).__init__(id)
|
||||
super().__init__(id)
|
||||
self.directory = directory
|
||||
self.file_extension = file_extension
|
||||
self.check_origin = check_origin
|
||||
|
@@ -11,9 +11,7 @@ class EnvVarSourceException(Exception):
|
||||
|
||||
class EnvironmentVariableNotFoundException(EnvVarSourceException):
|
||||
def __init__(self, data):
|
||||
super(EnvironmentVariableNotFoundException, self).__init__(
|
||||
f'Unknown environment variable {data}'
|
||||
)
|
||||
super().__init__(f'Unknown environment variable {data}')
|
||||
|
||||
|
||||
class EnvVarSource(BaseSource):
|
||||
@@ -73,7 +71,7 @@ class EnvVarSource(BaseSource):
|
||||
name,
|
||||
ttl,
|
||||
)
|
||||
super(EnvVarSource, self).__init__(id)
|
||||
super().__init__(id)
|
||||
self.envvar = variable
|
||||
self.name = name
|
||||
self.ttl = ttl
|
||||
|
@@ -23,7 +23,7 @@ class TinyDnsBaseSource(BaseSource):
|
||||
split_re = re.compile(r':+')
|
||||
|
||||
def __init__(self, id, default_ttl=3600):
|
||||
super(TinyDnsBaseSource, self).__init__(id)
|
||||
super().__init__(id)
|
||||
self.default_ttl = default_ttl
|
||||
|
||||
def _data_for_A(self, _type, records):
|
||||
@@ -239,7 +239,7 @@ class TinyDnsFileSource(TinyDnsBaseSource):
|
||||
directory,
|
||||
default_ttl,
|
||||
)
|
||||
super(TinyDnsFileSource, self).__init__(id, default_ttl)
|
||||
super().__init__(id, default_ttl)
|
||||
self.directory = directory
|
||||
self._cache = None
|
||||
|
||||
|
Reference in New Issue
Block a user