From bec4d025dcd1297ea71335339a209b3dc1962443 Mon Sep 17 00:00:00 2001 From: Brian Surowiec Date: Wed, 10 Mar 2021 15:57:50 -0500 Subject: [PATCH 01/18] Update branch name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f3ef4c..9d267d7 100644 --- a/README.md +++ b/README.md @@ -294,7 +294,7 @@ If you have a problem or suggestion, please [open an issue](https://github.com/o - **GitHub Action:** [OctoDNS-Sync](https://github.com/marketplace/actions/octodns-sync) - **Sample Implementations.** See how others are using it - [`hackclub/dns`](https://github.com/hackclub/dns) - - [`kubernetes/k8s.io:/dns`](https://github.com/kubernetes/k8s.io/tree/master/dns) + - [`kubernetes/k8s.io:/dns`](https://github.com/kubernetes/k8s.io/tree/main/dns) - [`g0v-network/domains`](https://github.com/g0v-network/domains) - [`jekyll/dns`](https://github.com/jekyll/dns) - **Custom Sources & Providers.** From 6c1cc47024ef1355abbc16f2daded10a8db0a1f9 Mon Sep 17 00:00:00 2001 From: Evgenii Tereshkov Date: Thu, 18 Mar 2021 02:31:10 +0700 Subject: [PATCH 03/18] Update README.md: fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d267d7..0a26da9 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ The `max_workers` key in the `manager` section of the config enables threading t In this example, `example.net` is an alias of zone `example.com`, which means they share the same sources and targets. They will therefore have identical records. -Now that we have something to tell OctoDNS about our providers & zones we need to tell it about or records. We'll keep it simple for now and just create a single `A` record at the top-level of the domain. +Now that we have something to tell OctoDNS about our providers & zones we need to tell it about our records. We'll keep it simple for now and just create a single `A` record at the top-level of the domain. `config/example.com.yaml` From 87450817461c912b26853d39a7ef5d7d50dd1b91 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Wed, 17 Mar 2021 17:04:10 -0700 Subject: [PATCH 04/18] Revert "Stopped running CI for doc changes." This reverts commit a8366aa02db6fac3d090f0d9a12edf3f7916ab4a. --- .github/workflows/main.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2f48dd..b68df8d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,5 @@ name: OctoDNS -on: - pull_request: - paths-ignore: - - '**.md' +on: [pull_request] jobs: ci: From 1aefa1a496271b2fc1922d9ddd55cf06a3e29123 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Mar 2021 21:56:29 +0000 Subject: [PATCH 05/18] Bump pyyaml from 5.3.1 to 5.4 Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4) Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8b9c052..933ac60 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -PyYaml==5.3.1 +PyYaml==5.4 azure-common==1.1.25 azure-mgmt-dns==3.0.0 boto3==1.15.9 From a99c71b3e566cb2619696c8a545028675127a6b5 Mon Sep 17 00:00:00 2001 From: Scott Little Date: Fri, 26 Mar 2021 19:48:38 +0100 Subject: [PATCH 06/18] Change the auth value to have a proper string not a binary rep --- octodns/provider/easydns.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octodns/provider/easydns.py b/octodns/provider/easydns.py index 835fcb9..d7a75a4 100644 --- a/octodns/provider/easydns.py +++ b/octodns/provider/easydns.py @@ -59,7 +59,7 @@ class EasyDNSClient(object): self.base_path = self.SANDBOX if sandbox else self.LIVE sess = Session() sess.headers.update({'Authorization': 'Basic {}' - .format(self.auth_key)}) + .format(self.auth_key.decode('utf-8'))}) sess.headers.update({'accept': 'application/json'}) self._sess = sess From 374a5c62f25e93f155f8066717b5eeb71b2d1552 Mon Sep 17 00:00:00 2001 From: Maikel Poot Date: Wed, 31 Mar 2021 12:49:01 +0200 Subject: [PATCH 07/18] Enable NS support for non-root NS records --- octodns/provider/transip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octodns/provider/transip.py b/octodns/provider/transip.py index 7458e36..ae2c5d5 100644 --- a/octodns/provider/transip.py +++ b/octodns/provider/transip.py @@ -50,7 +50,7 @@ class TransipProvider(BaseProvider): SUPPORTS_GEO = False SUPPORTS_DYNAMIC = False SUPPORTS = set( - ('A', 'AAAA', 'CNAME', 'MX', 'SRV', 'SPF', 'TXT', 'SSHFP', 'CAA')) + ('A', 'AAAA', 'CNAME', 'MX', 'SRV', 'SPF', 'TXT', 'SSHFP', 'CAA', 'NS')) # unsupported by OctoDNS: 'TLSA' MIN_TTL = 120 TIMEOUT = 15 From 87c31ca23d757a3de4606d830a9dc1e66fbe23f7 Mon Sep 17 00:00:00 2001 From: Maikel Poot Date: Wed, 31 Mar 2021 13:31:24 +0200 Subject: [PATCH 08/18] Update transip unittest --- tests/test_octodns_provider_transip.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_octodns_provider_transip.py b/tests/test_octodns_provider_transip.py index 84cfebc..234c95e 100644 --- a/tests/test_octodns_provider_transip.py +++ b/tests/test_octodns_provider_transip.py @@ -56,10 +56,11 @@ class MockDomainService(DomainService): _dns_entries.extend(entries_for(name, record)) - # NS is not supported as a DNS Entry, - # so it should cover the if statement + # Add a non-supported type + # so it triggers the "is supported" (transip.py:115) check and + # give 100% code coverage _dns_entries.append( - DnsEntry('@', '3600', 'NS', 'ns01.transip.nl.')) + DnsEntry('@', '3600', 'BOGUS', 'ns01.transip.nl.')) self.mockupEntries = _dns_entries @@ -222,7 +223,7 @@ N4OiVz1I3rbZGYa396lpxO6ku8yCglisL1yrSP6DdEUp66ntpKVd provider._client = MockDomainService('unittest', self.bogus_key) plan = provider.plan(_expected) - self.assertEqual(14, plan.change_counts['Create']) + self.assertEqual(15, plan.change_counts['Create']) self.assertEqual(0, plan.change_counts['Update']) self.assertEqual(0, plan.change_counts['Delete']) @@ -235,7 +236,7 @@ N4OiVz1I3rbZGYa396lpxO6ku8yCglisL1yrSP6DdEUp66ntpKVd provider = TransipProvider('test', 'unittest', self.bogus_key) provider._client = MockDomainService('unittest', self.bogus_key) plan = provider.plan(_expected) - self.assertEqual(14, len(plan.changes)) + self.assertEqual(15, len(plan.changes)) changes = provider.apply(plan) self.assertEqual(changes, len(plan.changes)) From 60e6f185cdbbf66544734bc2f6e21b65f4233f8c Mon Sep 17 00:00:00 2001 From: Maikel Poot Date: Wed, 31 Mar 2021 13:41:55 +0200 Subject: [PATCH 09/18] Update Documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a26da9..3186ed2 100644 --- a/README.md +++ b/README.md @@ -204,7 +204,7 @@ The above command pulled the existing data out of Route53 and placed the results | [Rackspace](/octodns/provider/rackspace.py) | | A, AAAA, ALIAS, CNAME, MX, NS, PTR, SPF, TXT | No | | | [Route53](/octodns/provider/route53.py) | boto3 | A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, SPF, SRV, TXT | Both | CNAME health checks don't support a Host header | | [Selectel](/octodns/provider/selectel.py) | | A, AAAA, CNAME, MX, NS, SPF, SRV, TXT | No | | -| [Transip](/octodns/provider/transip.py) | transip | A, AAAA, CNAME, MX, SRV, SPF, TXT, SSHFP, CAA | No | | +| [Transip](/octodns/provider/transip.py) | transip | A, AAAA, CNAME, MX, NS, SRV, SPF, TXT, SSHFP, CAA | No | | | [UltraDns](/octodns/provider/ultra.py) | | A, AAAA, CAA, CNAME, MX, NS, PTR, SPF, SRV, TXT | No | | | [AxfrSource](/octodns/source/axfr.py) | | A, AAAA, CAA, CNAME, LOC, MX, NS, PTR, SPF, SRV, TXT | No | read-only | | [ZoneFileSource](/octodns/source/axfr.py) | | A, AAAA, CAA, CNAME, MX, NS, PTR, SPF, SRV, TXT | No | read-only | From 840cb03bf432e8c7cfba2df25aed45e838fedb19 Mon Sep 17 00:00:00 2001 From: Maikel Poot Date: Wed, 31 Mar 2021 13:44:37 +0200 Subject: [PATCH 10/18] Fix lint error --- octodns/provider/transip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octodns/provider/transip.py b/octodns/provider/transip.py index ae2c5d5..6ccbe22 100644 --- a/octodns/provider/transip.py +++ b/octodns/provider/transip.py @@ -49,8 +49,8 @@ class TransipProvider(BaseProvider): ''' SUPPORTS_GEO = False SUPPORTS_DYNAMIC = False - SUPPORTS = set( - ('A', 'AAAA', 'CNAME', 'MX', 'SRV', 'SPF', 'TXT', 'SSHFP', 'CAA', 'NS')) + SUPPORTS = set(('A', 'AAAA', 'CNAME', 'MX', 'NS', 'SRV', 'SPF', 'TXT', + 'SSHFP', 'CAA')) # unsupported by OctoDNS: 'TLSA' MIN_TTL = 120 TIMEOUT = 15 From 090dbe351554ca3e929f099fa9e127aceedccd79 Mon Sep 17 00:00:00 2001 From: Christian Funkhouser Date: Wed, 7 Apr 2021 16:00:05 -0400 Subject: [PATCH 11/18] sync accepts file handle for plan output --- octodns/manager.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/octodns/manager.py b/octodns/manager.py index 9ce10ff..f4f1491 100644 --- a/octodns/manager.py +++ b/octodns/manager.py @@ -9,6 +9,7 @@ from concurrent.futures import ThreadPoolExecutor from importlib import import_module from os import environ from six import text_type +from sys import stdout import logging from .provider.base import BaseProvider @@ -267,7 +268,7 @@ class Manager(object): return plans, zone def sync(self, eligible_zones=[], eligible_sources=[], eligible_targets=[], - dry_run=True, force=False): + dry_run=True, force=False, plan_output_fh=stdout): self.log.info('sync: eligible_zones=%s, eligible_targets=%s, ' 'dry_run=%s, force=%s', eligible_zones, eligible_targets, dry_run, force) @@ -276,7 +277,7 @@ class Manager(object): if eligible_zones: zones = [z for z in zones if z[0] in eligible_zones] - aliased_zones = {} + aliased_zones = {} futures = [] for zone_name, config in zones: self.log.info('sync: zone=%s', zone_name) @@ -402,7 +403,7 @@ class Manager(object): plans.sort(key=self._plan_keyer, reverse=True) for output in self.plan_outputs.values(): - output.run(plans=plans, log=self.log) + output.run(plans=plans, log=self.log, fh=plan_output_fh) if not force: self.log.debug('sync: checking safety') From 2075550f078942d642c873bd2ec62343eb1a0f16 Mon Sep 17 00:00:00 2001 From: Christian Funkhouser Date: Wed, 7 Apr 2021 18:21:34 -0400 Subject: [PATCH 12/18] Test that Manager passes fh to _PlanOutputs --- octodns/manager.py | 5 +++-- tests/config/plan-output-filehandle.yaml | 6 ++++++ tests/test_octodns_manager.py | 23 ++++++++++++++++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 tests/config/plan-output-filehandle.yaml diff --git a/octodns/manager.py b/octodns/manager.py index f4f1491..e94e41e 100644 --- a/octodns/manager.py +++ b/octodns/manager.py @@ -270,8 +270,9 @@ class Manager(object): def sync(self, eligible_zones=[], eligible_sources=[], eligible_targets=[], dry_run=True, force=False, plan_output_fh=stdout): self.log.info('sync: eligible_zones=%s, eligible_targets=%s, ' - 'dry_run=%s, force=%s', eligible_zones, eligible_targets, - dry_run, force) + 'dry_run=%s, force=%s, plan_output_fh=%s', + eligible_zones, eligible_targets, dry_run, force, + plan_output_fh) zones = self.config['zones'].items() if eligible_zones: diff --git a/tests/config/plan-output-filehandle.yaml b/tests/config/plan-output-filehandle.yaml new file mode 100644 index 0000000..9c9bb87 --- /dev/null +++ b/tests/config/plan-output-filehandle.yaml @@ -0,0 +1,6 @@ +manager: + plan_outputs: + "doesntexist": + class: octodns.provider.plan.DoesntExist +providers: {} +zones: {} diff --git a/tests/test_octodns_manager.py b/tests/test_octodns_manager.py index 442ed49..003d414 100644 --- a/tests/test_octodns_manager.py +++ b/tests/test_octodns_manager.py @@ -8,7 +8,6 @@ from __future__ import absolute_import, division, print_function, \ from os import environ from os.path import dirname, join from six import text_type -from unittest import TestCase from octodns.record import Record from octodns.manager import _AggregateTarget, MainThreadExecutor, Manager, \ @@ -16,6 +15,10 @@ from octodns.manager import _AggregateTarget, MainThreadExecutor, Manager, \ from octodns.yaml import safe_load from octodns.zone import Zone +from mock import MagicMock, patch +from unittest import TestCase + + from helpers import DynamicProvider, GeoProvider, NoSshFpProvider, \ SimpleProvider, TemporaryDirectory @@ -371,6 +374,24 @@ class TestManager(TestCase): with self.assertRaises(TypeError): manager._populate_and_plan('unit.tests.', [NoZone()], []) + @patch('octodns.manager.Manager._get_named_class') + def test_sync_passes_file_handle(self, mock): + plan_output_mock = MagicMock() + plan_output_class_mock = MagicMock() + plan_output_class_mock.return_value = plan_output_mock + mock.return_value = plan_output_class_mock + fh_mock = MagicMock() + + Manager(get_config_filename('plan-output-filehandle.yaml') + ).sync(plan_output_fh=fh_mock) + + # Since we only care about the fh kwarg, and different _PlanOutputs are + # are free to require arbitrary kwargs anyway, we concern ourselves + # with checking the value of fh only. + plan_output_mock.run.assert_called() + _, kwargs = plan_output_mock.run.call_args + self.assertEqual(fh_mock, kwargs.get('fh')) + class TestMainThreadExecutor(TestCase): From 55c194c2032fd65b1d61b0309d3d9c55f8e22489 Mon Sep 17 00:00:00 2001 From: Christian Funkhouser Date: Thu, 8 Apr 2021 09:40:04 -0400 Subject: [PATCH 13/18] Update tests/test_octodns_manager.py Co-authored-by: Ross McFarland --- tests/test_octodns_manager.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_octodns_manager.py b/tests/test_octodns_manager.py index 003d414..91ee374 100644 --- a/tests/test_octodns_manager.py +++ b/tests/test_octodns_manager.py @@ -18,7 +18,6 @@ from octodns.zone import Zone from mock import MagicMock, patch from unittest import TestCase - from helpers import DynamicProvider, GeoProvider, NoSshFpProvider, \ SimpleProvider, TemporaryDirectory From aa93e20f2e4f7fa597e61f11a5096a34fea32f20 Mon Sep 17 00:00:00 2001 From: Christian Funkhouser Date: Thu, 8 Apr 2021 11:03:30 -0400 Subject: [PATCH 14/18] Represent plan_output_fh less verbosely. Co-authored-by: Ross McFarland --- octodns/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octodns/manager.py b/octodns/manager.py index e94e41e..7326207 100644 --- a/octodns/manager.py +++ b/octodns/manager.py @@ -272,7 +272,7 @@ class Manager(object): self.log.info('sync: eligible_zones=%s, eligible_targets=%s, ' 'dry_run=%s, force=%s, plan_output_fh=%s', eligible_zones, eligible_targets, dry_run, force, - plan_output_fh) + getattr(plan_output_fh, 'name', plan_output_fh.__class__.__name__)) zones = self.config['zones'].items() if eligible_zones: From ada61f8d764cf4175f83376d989eaec3984e716a Mon Sep 17 00:00:00 2001 From: Christian Funkhouser Date: Thu, 8 Apr 2021 11:56:17 -0400 Subject: [PATCH 15/18] De-lint an aggressively-long log line --- octodns/manager.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/octodns/manager.py b/octodns/manager.py index 7326207..9b10196 100644 --- a/octodns/manager.py +++ b/octodns/manager.py @@ -269,10 +269,12 @@ class Manager(object): def sync(self, eligible_zones=[], eligible_sources=[], eligible_targets=[], dry_run=True, force=False, plan_output_fh=stdout): - self.log.info('sync: eligible_zones=%s, eligible_targets=%s, ' - 'dry_run=%s, force=%s, plan_output_fh=%s', - eligible_zones, eligible_targets, dry_run, force, - getattr(plan_output_fh, 'name', plan_output_fh.__class__.__name__)) + + self.log.info( + 'sync: eligible_zones=%s, eligible_targets=%s, dry_run=%s, ' + 'force=%s, plan_output_fh=%s', + eligible_zones, eligible_targets, dry_run, force, + getattr(plan_output_fh, 'name', plan_output_fh.__class__.__name__)) zones = self.config['zones'].items() if eligible_zones: From 3451c79c6ac012a3dda29fdca36234a5bfe0966f Mon Sep 17 00:00:00 2001 From: Cadu Ribeiro Date: Wed, 21 Apr 2021 12:41:11 -0300 Subject: [PATCH 16/18] Change DNSimple's Provider to query zones instead domains A quick summary of a problem with have with DNSimple provider: Let's suppose that I have the following config: zones: 30.114.195.in-addr.arpa.: sources: - config targets: - dnsimple Even if a customer has this Reverse zone configured in DNSimple, this fails with: 400 Bad Request for url: https://api.sandbox.dnsimple.com/v2/x/domains because it is trying to create a domain because the zone wasn't found. octodns.provider.dnsimple.DnsimpleClientNotFound: Not found This happens because the GET /domains endpoint at DNSimple does not bring Reverse Zones. To make this work nice, we should use /zones/ instead making it return properly the reverse zones. --- octodns/provider/dnsimple.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/octodns/provider/dnsimple.py b/octodns/provider/dnsimple.py index 599eacb..a4b9350 100644 --- a/octodns/provider/dnsimple.py +++ b/octodns/provider/dnsimple.py @@ -51,8 +51,8 @@ class DnsimpleClient(object): resp.raise_for_status() return resp - def domain(self, name): - path = '/domains/{}'.format(name) + def zone(self, name): + path = '/zones/{}'.format(name) return self._request('GET', path).json() def domain_create(self, name): @@ -442,7 +442,7 @@ class DnsimpleProvider(BaseProvider): domain_name = desired.name[:-1] try: - self._client.domain(domain_name) + self._client.zone(domain_name) except DnsimpleClientNotFound: self.log.debug('_apply: no matching zone, creating domain') self._client.domain_create(domain_name) From e90aeb5d34fe0b1d423daffb2cdd2b831fbf1775 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Thu, 22 Apr 2021 18:45:14 -0700 Subject: [PATCH 17/18] pools used as fallbacks should count as seen --- octodns/record/__init__.py | 12 ++++++++---- tests/config/dynamic.tests.yaml | 23 +++++++++++++++++++++++ tests/test_octodns_provider_yaml.py | 14 +++++++++----- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/octodns/record/__init__.py b/octodns/record/__init__.py index 8ee2eaa..8c8760a 100644 --- a/octodns/record/__init__.py +++ b/octodns/record/__init__.py @@ -531,6 +531,7 @@ class _DynamicMixin(object): pools_exist = set() pools_seen = set() + pools_seen_as_fallback = set() if not isinstance(pools, dict): reasons.append('pools must be a dict') elif not pools: @@ -573,9 +574,12 @@ class _DynamicMixin(object): 'value {}'.format(_id, value_num)) fallback = pool.get('fallback', None) - if fallback is not None and fallback not in pools: - reasons.append('undefined fallback "{}" for pool "{}"' - .format(fallback, _id)) + if fallback is not None: + if fallback in pools: + pools_seen_as_fallback.add(fallback) + else: + reasons.append('undefined fallback "{}" for pool "{}"' + .format(fallback, _id)) # Check for loops fallback = pools[_id].get('fallback', None) @@ -644,7 +648,7 @@ class _DynamicMixin(object): reasons.extend(GeoCodes.validate(geo, 'rule {} ' .format(rule_num))) - unused = pools_exist - pools_seen + unused = pools_exist - pools_seen - pools_seen_as_fallback if unused: unused = '", "'.join(sorted(unused)) reasons.append('unused pools: "{}"'.format(unused)) diff --git a/tests/config/dynamic.tests.yaml b/tests/config/dynamic.tests.yaml index 4bd97a7..d25f63a 100644 --- a/tests/config/dynamic.tests.yaml +++ b/tests/config/dynamic.tests.yaml @@ -109,6 +109,29 @@ cname: - pool: iad type: CNAME value: target.unit.tests. +pool-only-in-fallback: + dynamic: + pools: + one: + fallback: two + values: + - value: 1.1.1.1 + three: + values: + - value: 3.3.3.3 + two: + values: + - value: 2.2.2.2 + rules: + - geos: + - NA-US + pool: one + - geos: + - AS-SG + pool: three + ttl: 300 + type: A + values: [4.4.4.4] real-ish-a: dynamic: pools: diff --git a/tests/test_octodns_provider_yaml.py b/tests/test_octodns_provider_yaml.py index 2ce9b4a..872fcca 100644 --- a/tests/test_octodns_provider_yaml.py +++ b/tests/test_octodns_provider_yaml.py @@ -38,7 +38,7 @@ class TestYamlProvider(TestCase): self.assertEquals(22, len(zone.records)) source.populate(dynamic_zone) - self.assertEquals(5, len(dynamic_zone.records)) + self.assertEquals(6, len(dynamic_zone.records)) # Assumption here is that a clean round-trip means that everything # worked as expected, data that went in came back out and could be @@ -68,11 +68,11 @@ class TestYamlProvider(TestCase): # Dynamic plan plan = target.plan(dynamic_zone) - self.assertEquals(5, len([c for c in plan.changes + self.assertEquals(6, len([c for c in plan.changes if isinstance(c, Create)])) self.assertFalse(isfile(dynamic_yaml_file)) # Apply it - self.assertEquals(5, target.apply(plan)) + self.assertEquals(6, target.apply(plan)) self.assertTrue(isfile(dynamic_yaml_file)) # There should be no changes after the round trip @@ -148,6 +148,10 @@ class TestYamlProvider(TestCase): self.assertTrue('value' in dyna) # self.assertTrue('dynamic' in dyna) + dyna = data.pop('pool-only-in-fallback') + self.assertTrue('value' in dyna) + # self.assertTrue('dynamic' in dyna) + # make sure nothing is left self.assertEquals([], list(data.keys())) @@ -397,7 +401,7 @@ class TestOverridingYamlProvider(TestCase): # Load the base, should see the 5 records base.populate(zone) got = {r.name: r for r in zone.records} - self.assertEquals(5, len(got)) + self.assertEquals(6, len(got)) # We get the "dynamic" A from the base config self.assertTrue('dynamic' in got['a'].data) # No added @@ -406,7 +410,7 @@ class TestOverridingYamlProvider(TestCase): # Load the overrides, should replace one and add 1 override.populate(zone) got = {r.name: r for r in zone.records} - self.assertEquals(6, len(got)) + self.assertEquals(7, len(got)) # 'a' was replaced with a generic record self.assertEquals({ 'ttl': 3600, From 3f3d500152baa55e9d88c27ced0e83101699472c Mon Sep 17 00:00:00 2001 From: Ricard Bejarano Date: Mon, 26 Apr 2021 19:06:29 +0200 Subject: [PATCH 18/18] fixed missing whitespace in plan() debug logging When debug logging is enabled, the plan() function logs lines like: Plan: DEBUG: __init__: Creates=13, Updates=0, Deletes=0Existing=0 Where a space between "Deletes=0" and "Existing=0" is missing. This adds it. --- octodns/provider/plan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octodns/provider/plan.py b/octodns/provider/plan.py index af6863a..69bd2b2 100644 --- a/octodns/provider/plan.py +++ b/octodns/provider/plan.py @@ -50,7 +50,7 @@ class Plan(object): except AttributeError: existing_n = 0 - self.log.debug('__init__: Creates=%d, Updates=%d, Deletes=%d' + self.log.debug('__init__: Creates=%d, Updates=%d, Deletes=%d ' 'Existing=%d', self.change_counts['Create'], self.change_counts['Update'],