Browse Source

Merge pull request #207 from sshmanko/master

fix logging for update/delete_pcent_threshold
pull/208/head
Ross McFarland 8 years ago
committed by GitHub
parent
commit
d08e66d6d1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions
  1. +2
    -1
      octodns/provider/base.py
  2. +6
    -6
      octodns/provider/plan.py

+ 2
- 1
octodns/provider/base.py View File

@ -17,7 +17,8 @@ class BaseProvider(BaseSource):
delete_pcent_threshold=Plan.MAX_SAFE_DELETE_PCENT):
super(BaseProvider, self).__init__(id)
self.log.debug('__init__: id=%s, apply_disabled=%s, '
'update_pcent_threshold=%d, delete_pcent_threshold=%d',
'update_pcent_threshold=%.2f'
'delete_pcent_threshold=%.2f',
id,
apply_disabled,
update_pcent_threshold,


+ 6
- 6
octodns/provider/plan.py View File

@ -60,17 +60,17 @@ class Plan(object):
delete_pcent = self.change_counts['Delete'] / existing_record_count
if update_pcent > self.update_pcent_threshold:
raise UnsafePlan('Too many updates, {} is over {} percent'
raise UnsafePlan('Too many updates, {:.2f} is over {:.2f} %'
'({}/{})'.format(
update_pcent,
self.MAX_SAFE_UPDATE_PCENT * 100,
update_pcent * 100,
self.update_pcent_threshold * 100,
self.change_counts['Update'],
existing_record_count))
if delete_pcent > self.delete_pcent_threshold:
raise UnsafePlan('Too many deletes, {} is over {} percent'
raise UnsafePlan('Too many deletes, {:.2f} is over {:.2f} %'
'({}/{})'.format(
delete_pcent,
self.MAX_SAFE_DELETE_PCENT * 100,
delete_pcent * 100,
self.delete_pcent_threshold * 100,
self.change_counts['Delete'],
existing_record_count))


Loading…
Cancel
Save