Created
December 22, 2025 01:07
-
-
Save Moraxyc/20c6ce7270d4162da9305efeb7ebf37f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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