Browse Source

Sort existing_rulesets by _ordering desc, so default is removed first

pull/222/head
Ross McFarland 8 years ago
parent
commit
4904a0ea20
No known key found for this signature in database GPG Key ID: 61C10C4FC8FE4A89
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      octodns/provider/dyn.py

+ 6
- 0
octodns/provider/dyn.py View File

@ -535,6 +535,12 @@ class DynProvider(BaseProvider):
for ruleset in existing_rulesets:
for pool in ruleset.response_pools:
pools[pool.response_pool_id] = pool
# Reverse sort the existing_rulesets by _ordering so that we'll remove
# them in that order later, this will ensure that we remove the old
# default before any of the old geo rules preventing it from catching
# everything.
existing_rulesets.sort(key=lambda r: r._ordering, reverse=True)
# Now we need to find any pools that aren't referenced by rules
for pool in td.all_response_pools:
rpid = pool.response_pool_id


Loading…
Cancel
Save