From aa88b877c4c4e08d0336a01b532d9d5b21dbedb3 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Mon, 23 Aug 2021 17:53:07 -0700 Subject: [PATCH] Clear NS1 zone cache before record cache --- octodns/provider/ns1.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/octodns/provider/ns1.py b/octodns/provider/ns1.py index 32a6b3e..1072245 100644 --- a/octodns/provider/ns1.py +++ b/octodns/provider/ns1.py @@ -205,10 +205,11 @@ class Ns1Client(object): def records_delete(self, zone, domain, _type): try: - # remove record from cache - del self._records_cache[zone][domain][_type] # remove record's zone from cache del self._zones_cache[zone] + # remove record from cache, after zone since we may not have + # fetched the record details + del self._records_cache[zone][domain][_type] except KeyError: # never mind if record is not found in cache pass @@ -224,10 +225,11 @@ class Ns1Client(object): def records_update(self, zone, domain, _type, **params): try: - # remove record from cache - del self._records_cache[zone][domain][_type] # remove record's zone from cache del self._zones_cache[zone] + # remove record from cache, after zone since we may not have + # fetched the record details + del self._records_cache[zone][domain][_type] except KeyError: # never mind if record is not found in cache pass