Browse Source

prevent invalid subnet from crashing us

pull/993/head
Viranch Mehta 3 years ago
parent
commit
eeec1a7e7b
No known key found for this signature in database GPG Key ID: D83D1392AE9F93B4
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      octodns/record/dynamic.py

+ 8
- 1
octodns/record/dynamic.py View File

@ -283,7 +283,14 @@ class _DynamicMixin(object):
reasons.extend( reasons.extend(
Subnets.validate(subnet, f'rule {rule_num} ') Subnets.validate(subnet, f'rule {rule_num} ')
) )
networks = [Subnets.parse(s) for s in subnets]
networks = []
for subnet in subnets:
try:
networks.append(Subnets.parse(subnet))
except:
# previous loop will log any invalid subnets, here we
# process only valid ones and skip invalid ones
pass
# sort subnets from largest to smallest so that we can # sort subnets from largest to smallest so that we can
# detect rule that have needlessly targeted a more specific # detect rule that have needlessly targeted a more specific
# subnet along with a larger subnet that already contains it # subnet along with a larger subnet that already contains it


Loading…
Cancel
Save