mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Update octodns/provider/plan.py
Refactor zone vs provider choice to read more cleanly Co-authored-by: Ross McFarland <rwmcfa1@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user