mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
prevent invalid subnet from crashing us
This commit is contained in:
@@ -283,7 +283,14 @@ class _DynamicMixin(object):
|
||||
reasons.extend(
|
||||
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
|
||||
# detect rule that have needlessly targeted a more specific
|
||||
# subnet along with a larger subnet that already contains it
|
||||
|
||||
Reference in New Issue
Block a user