From cd975b28f4887accf82bac6298a4ea206a826243 Mon Sep 17 00:00:00 2001 From: Viranch Mehta Date: Wed, 12 Apr 2023 23:36:37 -0700 Subject: [PATCH] Don't abort rest of the validation if unsupported pools are not present --- octodns/provider/base.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/octodns/provider/base.py b/octodns/provider/base.py index 75fe18d..e0f9b48 100644 --- a/octodns/provider/base.py +++ b/octodns/provider/base.py @@ -66,20 +66,21 @@ class BaseProvider(BaseSource): for value in pool.data['values']: if value['status'] != 'obey': unsupported_pools.append(_id) - if not unsupported_pools: - continue - unsupported_pools = ','.join(unsupported_pools) - msg = ( - f'"status" flag used in pools {unsupported_pools}' - f' in {record.fqdn} is not supported' - ) - fallback = 'will ignore it and respect the healthcheck' - self.supports_warn_or_except(msg, fallback) - record = record.copy() - for pool in record.dynamic.pools.values(): - for value in pool.data['values']: - value['status'] = 'obey' - desired.add_record(record, replace=True) + if unsupported_pools: + unsupported_pools = ','.join(unsupported_pools) + msg = ( + f'"status" flag used in pools {unsupported_pools}' + f' in {record.fqdn} is not supported' + ) + fallback = ( + 'will ignore it and respect the healthcheck' + ) + self.supports_warn_or_except(msg, fallback) + record = record.copy() + for pool in record.dynamic.pools.values(): + for value in pool.data['values']: + value['status'] = 'obey' + desired.add_record(record, replace=True) if not self.SUPPORTS_DYNAMIC_SUBNETS: subnet_rules = []