From 28f3a75061248bba82f34357b96c8e56f4b4425b Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Wed, 9 Jan 2019 10:55:18 -0800 Subject: [PATCH] _find_or_create_*_pool should add new pool to pools so it can find next time --- octodns/provider/dyn.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/octodns/provider/dyn.py b/octodns/provider/dyn.py index 0c23b45..1832759 100644 --- a/octodns/provider/dyn.py +++ b/octodns/provider/dyn.py @@ -859,6 +859,13 @@ class DynProvider(BaseProvider): chain = DSFFailoverChain(label, record_sets=[record_set]) pool = DSFResponsePool(label, rs_chains=[chain]) pool.create(td) + + # We need to store the newly created pool in the pools list since the + # caller won't know if it was newly created or not. This will allow us + # to find this pool again if another rule references it and avoid + # creating duplicates + pools.append(pool) + return pool def _dynamic_records_for_A(self, values, record_extras): @@ -908,6 +915,13 @@ class DynProvider(BaseProvider): chain = DSFFailoverChain(label, record_sets=[record_set]) pool = DSFResponsePool(label, rs_chains=[chain]) pool.create(td) + + # We need to store the newly created pool in the pools list since the + # caller won't know if it was newly created or not. This will allow us + # to find this pool again if another rule references it and avoid + # creating duplicates + pools.append(pool) + return pool def _mod_geo_rulesets(self, td, change):