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

POC of processors concept that can hook in to modify zones

This commit is contained in:
Ross McFarland
2020-12-03 17:50:56 -08:00
parent f9aa08b38b
commit e4d6084b4c
5 changed files with 106 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ class BaseProvider(BaseSource):
'''
return []
def plan(self, desired):
def plan(self, desired, processors=[]):
self.log.info('plan: desired=%s', desired.name)
existing = Zone(desired.name, desired.sub_zones)
@@ -55,6 +55,9 @@ class BaseProvider(BaseSource):
self.log.warn('Provider %s used in target mode did not return '
'exists', self.id)
for processor in processors:
existing = processor.process(existing)
# compute the changes at the zone/record level
changes = existing.changes(desired, self)