mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Tell the processor when it's being called in a target context
This commit is contained in:
@@ -14,7 +14,7 @@ class TypeAllowlistFilter(BaseProcessor):
|
|||||||
super(TypeAllowlistFilter, self).__init__(name)
|
super(TypeAllowlistFilter, self).__init__(name)
|
||||||
self.allowlist = allowlist
|
self.allowlist = allowlist
|
||||||
|
|
||||||
def process(self, zone):
|
def process(self, zone, target=False):
|
||||||
ret = self._create_zone(zone)
|
ret = self._create_zone(zone)
|
||||||
for record in zone.records:
|
for record in zone.records:
|
||||||
if record._type in self.allowlist:
|
if record._type in self.allowlist:
|
||||||
@@ -29,7 +29,7 @@ class TypeRejectlistFilter(BaseProcessor):
|
|||||||
super(TypeRejectlistFilter, self).__init__(name)
|
super(TypeRejectlistFilter, self).__init__(name)
|
||||||
self.rejectlist = rejectlist
|
self.rejectlist = rejectlist
|
||||||
|
|
||||||
def process(self, zone):
|
def process(self, zone, target=False):
|
||||||
ret = self._create_zone(zone)
|
ret = self._create_zone(zone)
|
||||||
for record in zone.records:
|
for record in zone.records:
|
||||||
if record._type not in self.rejectlist:
|
if record._type not in self.rejectlist:
|
||||||
|
@@ -56,7 +56,7 @@ class BaseProvider(BaseSource):
|
|||||||
'exists', self.id)
|
'exists', self.id)
|
||||||
|
|
||||||
for processor in processors:
|
for processor in processors:
|
||||||
existing = processor.process(existing)
|
existing = processor.process(existing, target=True)
|
||||||
|
|
||||||
# compute the changes at the zone/record level
|
# compute the changes at the zone/record level
|
||||||
changes = existing.changes(desired, self)
|
changes = existing.changes(desired, self)
|
||||||
|
Reference in New Issue
Block a user