From 303e439a541731ed0bbe16ff7f16e0f78bbbe62e Mon Sep 17 00:00:00 2001 From: Sham Date: Wed, 30 Jun 2021 12:11:54 -0700 Subject: [PATCH 1/2] skip monitors that are not managed by OctoDNS --- octodns/provider/ns1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/octodns/provider/ns1.py b/octodns/provider/ns1.py index bf08358..510b099 100644 --- a/octodns/provider/ns1.py +++ b/octodns/provider/ns1.py @@ -849,6 +849,8 @@ class Ns1Provider(BaseProvider): for monitor in self._client.monitors.values(): data = self._parse_notes(monitor['notes']) + if not data: + continue if expected_host == data['host'] and \ expected_type == data['type']: # This monitor does not belong to this record From 7f3aafe6a416212ca24900223a7b60ccd8801fb6 Mon Sep 17 00:00:00 2001 From: Sham Date: Thu, 1 Jul 2021 00:31:17 -0700 Subject: [PATCH 2/2] added tests for both non-confirming notes as well as empty notes in existing monitors --- tests/test_octodns_provider_ns1.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_octodns_provider_ns1.py b/tests/test_octodns_provider_ns1.py index df517a2..e21fe0d 100644 --- a/tests/test_octodns_provider_ns1.py +++ b/tests/test_octodns_provider_ns1.py @@ -659,6 +659,18 @@ class TestNs1ProviderDynamic(TestCase): }, 'four': monitor_four, 'five': monitor_five, + 'six': { + 'config': { + 'host': '10.10.10.10', + }, + 'notes': 'non-conforming notes', + }, + 'seven': { + 'config': { + 'host': '11.11.11.11', + }, + 'notes': None, + }, } # Would match, but won't get there b/c it's not dynamic