1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Processor.name -> id to match everything else

This commit is contained in:
Ross McFarland
2023-09-13 12:31:49 -07:00
parent ccb4f97a2f
commit 686868ca35
7 changed files with 25 additions and 24 deletions

View File

@@ -10,7 +10,7 @@ from .base import BaseProcessor
class AcmeMangingProcessor(BaseProcessor):
log = getLogger('AcmeMangingProcessor')
def __init__(self, name):
def __init__(self, id):
'''
processors:
acme:
@@ -25,7 +25,7 @@ class AcmeMangingProcessor(BaseProcessor):
- acme
...
'''
super().__init__(name)
super().__init__(id)
self._owned = set()

View File

@@ -11,9 +11,9 @@ from .base import BaseProcessor
class AutoArpa(BaseProcessor):
def __init__(self, name, ttl=3600, populate_should_replace=False):
super().__init__(name)
self.log = getLogger(f'AutoArpa[{name}]')
def __init__(self, id, ttl=3600, populate_should_replace=False):
super().__init__(id)
self.log = getLogger(f'AutoArpa[{id}]')
self.log.info(
'__init__: ttl=%d, populate_should_replace=%s',
ttl,

View File

@@ -8,8 +8,9 @@ class ProcessorException(Exception):
class BaseProcessor(object):
def __init__(self, name):
self.name = name
def __init__(self, id):
# TODO: name is DEPRECATED and will be removed with 2.0
self.id = self.name = id
def process_source_zone(self, desired, sources):
'''

View File

@@ -29,8 +29,8 @@ class TypeAllowlistFilter(BaseProcessor):
- ns1
'''
def __init__(self, name, allowlist):
super().__init__(name)
def __init__(self, id, allowlist):
super().__init__(id)
self.allowlist = set(allowlist)
def _process(self, zone, *args, **kwargs):
@@ -65,8 +65,8 @@ class TypeRejectlistFilter(BaseProcessor):
- route53
'''
def __init__(self, name, rejectlist):
super().__init__(name)
def __init__(self, id, rejectlist):
super().__init__(id)
self.rejectlist = set(rejectlist)
def _process(self, zone, *args, **kwargs):
@@ -81,8 +81,8 @@ class TypeRejectlistFilter(BaseProcessor):
class _NameBaseFilter(BaseProcessor):
def __init__(self, name, _list):
super().__init__(name)
def __init__(self, id, _list):
super().__init__(id)
exact = set()
regex = []
for pattern in _list:
@@ -122,8 +122,8 @@ class NameAllowlistFilter(_NameBaseFilter):
- route53
'''
def __init__(self, name, allowlist):
super().__init__(name, allowlist)
def __init__(self, id, allowlist):
super().__init__(id, allowlist)
def _process(self, zone, *args, **kwargs):
for record in zone.records:
@@ -169,8 +169,8 @@ class NameRejectlistFilter(_NameBaseFilter):
- route53
'''
def __init__(self, name, rejectlist):
super().__init__(name, rejectlist)
def __init__(self, id, rejectlist):
super().__init__(id, rejectlist)
def _process(self, zone, *args, **kwargs):
for record in zone.records:

View File

@@ -13,8 +13,8 @@ from .base import BaseProcessor
# delete. We'll take ownership of existing records that we're told to manage
# and thus "own" them going forward.
class OwnershipProcessor(BaseProcessor):
def __init__(self, name, txt_name='_owner', txt_value='*octodns*'):
super().__init__(name)
def __init__(self, id, txt_name='_owner', txt_value='*octodns*'):
super().__init__(id)
self.txt_name = txt_name
self.txt_value = txt_value
self._txt_values = [txt_value]

View File

@@ -51,8 +51,8 @@ class TtlRestrictionFilter(BaseProcessor):
SEVEN_DAYS = 60 * 60 * 24 * 7
def __init__(self, name, min_ttl=1, max_ttl=SEVEN_DAYS, allowed_ttls=None):
super().__init__(name)
def __init__(self, id, min_ttl=1, max_ttl=SEVEN_DAYS, allowed_ttls=None):
super().__init__(id)
self.min_ttl = min_ttl
self.max_ttl = max_ttl
self.allowed_ttls = set(allowed_ttls) if allowed_ttls else None

View File

@@ -53,12 +53,12 @@ class SpfDnsLookupProcessor(BaseProcessor):
log = getLogger('SpfDnsLookupProcessor')
def __init__(self, name):
self.log.debug(f"SpfDnsLookupProcessor: {name}")
def __init__(self, id):
self.log.debug('__init__:')
self.log.warning(
'SpfDnsLookupProcessor is DEPRECATED in favor of the version relocated into octodns-spf and will be removed in 2.0'
)
super().__init__(name)
super().__init__(id)
def _get_spf_from_txt_values(
self, record: Record, values: List[str]