From cca288faa6463e2abfd572612ff1209e8d1053c5 Mon Sep 17 00:00:00 2001 From: Viranch Mehta Date: Mon, 17 May 2021 13:19:43 -0700 Subject: [PATCH] log warning when non-1 weight is set for single-value pools --- octodns/record/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/octodns/record/__init__.py b/octodns/record/__init__.py index cc503d6..45cea51 100644 --- a/octodns/record/__init__.py +++ b/octodns/record/__init__.py @@ -417,6 +417,7 @@ class _ValueMixin(object): class _DynamicPool(object): + log = getLogger('_DynamicPool') def __init__(self, _id, data): self._id = _id @@ -431,7 +432,12 @@ class _DynamicPool(object): # normalize weight of a single-value pool if len(values) == 1: - values[0]['weight'] = 1 + weight = data['values'][0].get('weight', 1) + if weight != 1: + self.log.warn( + 'Using weight=1 instead of %s for single-value pool %s', + weight, _id) + values[0]['weight'] = 1 fallback = data.get('fallback', None) self.data = {