Browse Source

Update octodns/provider/plan.py

Refactor zone vs provider choice to read more cleanly

Co-authored-by: Ross McFarland <rwmcfa1@gmail.com>
pull/1159/head
Matt Cholick 2 years ago
committed by GitHub
parent
commit
2bc961a66d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      octodns/provider/plan.py

+ 4
- 3
octodns/provider/plan.py View File

@ -57,15 +57,16 @@ class Plan(object):
# them and/or is as safe as possible.
self.changes = sorted(changes)
self.exists = exists
self.update_pcent_threshold = update_pcent_threshold
self.delete_pcent_threshold = delete_pcent_threshold
# Zone thresholds take precedence over provider
if existing and existing.update_pcent_threshold is not None:
self.update_pcent_threshold = existing.update_pcent_threshold
else:
self.update_pcent_threshold = update_pcent_threshold
if existing and existing.delete_pcent_threshold is not None:
self.delete_pcent_threshold = existing.delete_pcent_threshold
else:
self.delete_pcent_threshold = delete_pcent_threshold
change_counts = {'Create': 0, 'Delete': 0, 'Update': 0}
for change in changes:
change_counts[change.__class__.__name__] += 1


Loading…
Cancel
Save