From e1b2de656cddfb106b2e00acc3431b5c4305faf1 Mon Sep 17 00:00:00 2001 From: Phelps Williams Date: Mon, 20 Jul 2020 17:42:47 -0700 Subject: [PATCH 01/10] octodns-compare: Prefix filtering and status code on configuration mismatch --- octodns/cmds/compare.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/octodns/cmds/compare.py b/octodns/cmds/compare.py index 4123643..9bf9f1c 100755 --- a/octodns/cmds/compare.py +++ b/octodns/cmds/compare.py @@ -7,6 +7,7 @@ from __future__ import absolute_import, division, print_function, \ unicode_literals from pprint import pprint +import sys from octodns.cmds.args import ArgumentParser from octodns.manager import Manager @@ -23,13 +24,25 @@ def main(): help='Second source(s) to pull data from') parser.add_argument('--zone', default=None, required=True, help='Zone to compare') - + parser.add_argument('--ignore-prefix', default=None, required=False, + help='Record prefix to ignore from list of changes') args = parser.parse_args() manager = Manager(args.config_file) changes = manager.compare(args.a, args.b, args.zone) + + # Filter changes list based on ignore-prefix argument if present + if args.ignore_prefix: + pattern = args.ignore_prefix + changes = [c for c in changes + if not c.record.fqdn.startswith(pattern)] + pprint(changes) + # Exit with non-zero exit code if changes exist + if len(changes): + sys.exit(1) + if __name__ == '__main__': main() From b69fc3230087626f397c59dc025c62d3e8f5b860 Mon Sep 17 00:00:00 2001 From: rupa Date: Thu, 20 Aug 2020 16:03:30 -0400 Subject: [PATCH 02/10] Update README.md NS1 does support CNAME via octodns :) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f015dbc..23ac0e8 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ The above command pulled the existing data out of Route53 and placed the results | [EnvVarSource](/octodns/source/envvar.py) | | TXT | No | read-only environment variable injection | | [GoogleCloudProvider](/octodns/provider/googlecloud.py) | google-cloud-dns | A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, SPF, SRV, TXT | No | | | [MythicBeastsProvider](/octodns/provider/mythicbeasts.py) | Mythic Beasts | A, AAAA, ALIAS, CNAME, MX, NS, SRV, SSHFP, CAA, TXT | No | | -| [Ns1Provider](/octodns/provider/ns1.py) | ns1-python | All | Yes | No CNAME support, missing `NA` geo target | +| [Ns1Provider](/octodns/provider/ns1.py) | ns1-python | All | Yes | Missing `NA` geo target | | [OVH](/octodns/provider/ovh.py) | ovh | A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, SPF, SRV, SSHFP, TXT, DKIM | No | | | [PowerDnsProvider](/octodns/provider/powerdns.py) | | All | No | | | [Rackspace](/octodns/provider/rackspace.py) | | A, AAAA, ALIAS, CNAME, MX, NS, PTR, SPF, TXT | No | | From 31105cc472b33412ef024f11fecc3f8cca33cfd8 Mon Sep 17 00:00:00 2001 From: Guillaume Gelin Date: Thu, 27 Aug 2020 16:02:11 +0200 Subject: [PATCH 03/10] Implement octodns-sync --source It can be useful to only synchronize zones that use a certain source. For example, in a situation where some zones use a dynamic source and others don't, you probably want to synchronize those with a dynamic source regularly, and only synchronize the others when a change is made. Although we only synchronize the zones that use a given source, we still want to synchronize all sources to avoid deleting records that would live in another source of the zone. --- octodns/cmds/sync.py | 13 +++++++------ octodns/manager.py | 10 ++++++++-- tests/test_octodns_manager.py | 8 ++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/octodns/cmds/sync.py b/octodns/cmds/sync.py index 60793e7..dbf4103 100755 --- a/octodns/cmds/sync.py +++ b/octodns/cmds/sync.py @@ -25,18 +25,19 @@ def main(): parser.add_argument('zone', nargs='*', default=[], help='Limit sync to the specified zone(s)') - # --sources isn't an option here b/c filtering sources out would be super - # dangerous since you could easily end up with an empty zone and delete - # everything, or even just part of things when there are multiple sources - + parser.add_argument('--source', default=[], action='append', + help='Limit sync to zones with the specified ' + 'source(s) (all sources will be synchronized for the ' + 'selected zones)') parser.add_argument('--target', default=[], action='append', help='Limit sync to the specified target(s)') args = parser.parse_args() manager = Manager(args.config_file) - manager.sync(eligible_zones=args.zone, eligible_targets=args.target, - dry_run=not args.doit, force=args.force) + manager.sync(eligible_zones=args.zone, eligible_sources=args.source, + eligible_targets=args.target, dry_run=not args.doit, + force=args.force) if __name__ == '__main__': diff --git a/octodns/manager.py b/octodns/manager.py index 0665938..288645f 100644 --- a/octodns/manager.py +++ b/octodns/manager.py @@ -255,8 +255,8 @@ class Manager(object): return plans - def sync(self, eligible_zones=[], eligible_targets=[], dry_run=True, - force=False): + def sync(self, eligible_zones=[], eligible_sources=[], eligible_targets=[], + dry_run=True, force=False): self.log.info('sync: eligible_zones=%s, eligible_targets=%s, ' 'dry_run=%s, force=%s', eligible_zones, eligible_targets, dry_run, force) @@ -280,6 +280,12 @@ class Manager(object): except KeyError: raise ManagerException('Zone {} is missing targets' .format(zone_name)) + + if (eligible_sources and not + [s for s in sources if s in eligible_sources]): + self.log.info('sync: no eligible sources, skipping') + continue + if eligible_targets: targets = [t for t in targets if t in eligible_targets] diff --git a/tests/test_octodns_manager.py b/tests/test_octodns_manager.py index 581689a..9956790 100644 --- a/tests/test_octodns_manager.py +++ b/tests/test_octodns_manager.py @@ -151,6 +151,14 @@ class TestManager(TestCase): .sync(dry_run=False, force=True) self.assertEquals(25, tc) + def test_eligible_sources(self): + with TemporaryDirectory() as tmpdir: + environ['YAML_TMP_DIR'] = tmpdir.dirname + # Only allow a target that doesn't exist + tc = Manager(get_config_filename('simple.yaml')) \ + .sync(eligible_sources=['foo']) + self.assertEquals(0, tc) + def test_eligible_targets(self): with TemporaryDirectory() as tmpdir: environ['YAML_TMP_DIR'] = tmpdir.dirname From 58535b3b6976c8e2ec11ab38abb41f784d31e783 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2020 08:54:31 +0000 Subject: [PATCH 04/10] Bump pycountry from 19.8.18 to 20.7.3 Bumps [pycountry](https://github.com/flyingcircusio/pycountry) from 19.8.18 to 20.7.3. - [Release notes](https://github.com/flyingcircusio/pycountry/releases) - [Changelog](https://github.com/flyingcircusio/pycountry/blob/master/HISTORY.txt) - [Commits](https://github.com/flyingcircusio/pycountry/compare/19.8.18...20.7.3) Signed-off-by: dependabot-preview[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index dd1643f..a2ac48a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ natsort==6.2.1 ns1-python==0.16.0 ovh==0.5.0 pycountry-convert==0.7.2 -pycountry==19.8.18 +pycountry==20.7.3 python-dateutil==2.8.1 requests==2.24.0 s3transfer==0.3.3 From 179c89573fb0c7a882d6d5c2eb39ae8b97a9dca7 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2020 14:54:26 +0000 Subject: [PATCH 05/10] Bump google-cloud-core from 1.3.0 to 1.4.1 Bumps [google-cloud-core](https://github.com/googleapis/python-cloud-core) from 1.3.0 to 1.4.1. - [Release notes](https://github.com/googleapis/python-cloud-core/releases) - [Changelog](https://github.com/googleapis/python-cloud-core/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/python-cloud-core/compare/v1.3.0...v1.4.1) Signed-off-by: dependabot-preview[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a2ac48a..065eeba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ docutils==0.16 dyn==1.8.1 edgegrid-python==1.1.1 futures==3.2.0; python_version < '3.2' -google-cloud-core==1.3.0 +google-cloud-core==1.4.1 google-cloud-dns==0.32.0 ipaddress==1.0.23; python_version < '3.3' jmespath==0.10.0 From cfa4ac03dd57975aaeeca23f351a11899e536546 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2020 14:57:57 +0000 Subject: [PATCH 06/10] Bump botocore from 1.17.14 to 1.17.52 Bumps [botocore](https://github.com/boto/botocore) from 1.17.14 to 1.17.52. - [Release notes](https://github.com/boto/botocore/releases) - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.17.14...1.17.52) Signed-off-by: dependabot-preview[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 065eeba..03f1158 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ PyYaml==5.3.1 azure-common==1.1.25 azure-mgmt-dns==3.0.0 boto3==1.14.14 -botocore==1.17.14 +botocore==1.17.52 dnspython==1.16.0 docutils==0.16 dyn==1.8.1 From 229d77eda7d46fb5d50a921204f23028100465bf Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2020 15:04:28 +0000 Subject: [PATCH 07/10] Bump boto3 from 1.14.14 to 1.14.52 Bumps [boto3](https://github.com/boto/boto3) from 1.14.14 to 1.14.52. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.14.14...1.14.52) Signed-off-by: dependabot-preview[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 03f1158..24f57ff 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ PyYaml==5.3.1 azure-common==1.1.25 azure-mgmt-dns==3.0.0 -boto3==1.14.14 +boto3==1.14.52 botocore==1.17.52 dnspython==1.16.0 docutils==0.16 From aad1467d5ace2320aa1704185dfe49d77fd657e8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 1 Oct 2020 08:06:50 +0000 Subject: [PATCH 08/10] Bump botocore from 1.17.52 to 1.18.9 Bumps [botocore](https://github.com/boto/botocore) from 1.17.52 to 1.18.9. - [Release notes](https://github.com/boto/botocore/releases) - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.17.52...1.18.9) Signed-off-by: dependabot-preview[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 24f57ff..e359ffc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ PyYaml==5.3.1 azure-common==1.1.25 azure-mgmt-dns==3.0.0 boto3==1.14.52 -botocore==1.17.52 +botocore==1.18.9 dnspython==1.16.0 docutils==0.16 dyn==1.8.1 From 832e481ea4ecd7dfe6d01c0421a327656194ef3e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 1 Oct 2020 12:55:18 +0000 Subject: [PATCH 09/10] Bump boto3 from 1.14.52 to 1.15.9 Bumps [boto3](https://github.com/boto/boto3) from 1.14.52 to 1.15.9. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.14.52...1.15.9) Signed-off-by: dependabot-preview[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e359ffc..bc9a019 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ PyYaml==5.3.1 azure-common==1.1.25 azure-mgmt-dns==3.0.0 -boto3==1.14.52 +boto3==1.15.9 botocore==1.18.9 dnspython==1.16.0 docutils==0.16 From 50f739495d10310cfb6b8425eda1a26b2b94b40c Mon Sep 17 00:00:00 2001 From: ftm-qsc <54101720+ftm-qsc@users.noreply.github.com> Date: Wed, 14 Oct 2020 20:45:49 +0200 Subject: [PATCH 10/10] docs: fixed small typo in geo_records.md Did you mean 'strongly'? --- docs/geo_records.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/geo_records.md b/docs/geo_records.md index ba99260..3777564 100644 --- a/docs/geo_records.md +++ b/docs/geo_records.md @@ -1,6 +1,6 @@ ## Geo Record Support -Note: Geo DNS records are still supported for the time being, but it is still strongy encouraged that you look at [Dynamic Records](/docs/dynamic_records.md) instead as they are a superset of functionality. +Note: Geo DNS records are still supported for the time being, but it is still strongly encouraged that you look at [Dynamic Records](/docs/dynamic_records.md) instead as they are a superset of functionality. GeoDNS is currently supported for `A` and `AAAA` records on the Dyn (via Traffic Directors) and Route53 providers. Records with geo information pushed to providers without support for them will be managed as non-geo records using the base values.