Browse Source

Processor.name -> id to match everything else

processor-id
Ross McFarland 2 years ago
parent
commit
686868ca35
No known key found for this signature in database GPG Key ID: 943B179E15D3B22A
7 changed files with 25 additions and 24 deletions
  1. +2
    -2
      octodns/processor/acme.py
  2. +3
    -3
      octodns/processor/arpa.py
  3. +3
    -2
      octodns/processor/base.py
  4. +10
    -10
      octodns/processor/filter.py
  5. +2
    -2
      octodns/processor/ownership.py
  6. +2
    -2
      octodns/processor/restrict.py
  7. +3
    -3
      octodns/processor/spf.py

+ 2
- 2
octodns/processor/acme.py 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()


+ 3
- 3
octodns/processor/arpa.py 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,


+ 3
- 2
octodns/processor/base.py 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):
'''


+ 10
- 10
octodns/processor/filter.py 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:


+ 2
- 2
octodns/processor/ownership.py 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]


+ 2
- 2
octodns/processor/restrict.py 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


+ 3
- 3
octodns/processor/spf.py 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]


Loading…
Cancel
Save