Skip to content

Instantly share code, notes, and snippets.

@Moraxyc
Created December 22, 2025 01:07
Show Gist options
  • Select an option

  • Save Moraxyc/20c6ce7270d4162da9305efeb7ebf37f to your computer and use it in GitHub Desktop.

Select an option

Save Moraxyc/20c6ce7270d4162da9305efeb7ebf37f to your computer and use it in GitHub Desktop.
from octodns.processor.base import BaseProcessor
from octodns.record.change import Delete
class NoDelete(BaseProcessor):
def __init__(self, name):
super(NoDelete, self).__init__(name)
def process_plan(self, plan, *args, **kwargs):
if not plan or not plan.changes:
return plan
original_count = len(plan.changes)
kept_changes = [c for c in plan.changes if not isinstance(c, Delete)]
diff = original_count - len(kept_changes)
if diff > 0:
print(f"[NoDelete] Prevented {diff} records from being deleted.")
plan.changes = kept_changes
return plan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment