Browse Source

Merge pull request #293 from begincalendar/octodns-output-for-yaml

WIP: Add (non-empty) Record._octodns dict to YAML file output
pull/295/head
Ross McFarland 7 years ago
committed by GitHub
parent
commit
8b535908a9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions
  1. +2
    -0
      octodns/provider/yaml.py
  2. +6
    -0
      tests/test_octodns_provider_yaml.py

+ 2
- 0
octodns/provider/yaml.py View File

@ -89,6 +89,8 @@ class YamlProvider(BaseProvider):
if record.ttl == self.default_ttl:
# ttl is the default, we don't need to store it
del d['ttl']
if record._octodns:
d['octodns'] = record._octodns
data[record.name].append(d)
# Flatten single element lists


+ 6
- 0
tests/test_octodns_provider_yaml.py View File

@ -60,6 +60,12 @@ class TestYamlProvider(TestCase):
# There should be no changes after the round trip
reloaded = Zone('unit.tests.', [])
target.populate(reloaded)
self.assertDictEqual(
{'included': ['test']},
filter(
lambda x: x.name == 'included', reloaded.records
)[0]._octodns)
self.assertFalse(zone.changes(reloaded, target=source))
# A 2nd sync should still create everything


Loading…
Cancel
Save