Browse Source

Raise exception when no yamls are found for a zone

pull/1067/head
Viranch Mehta 2 years ago
parent
commit
11118efe93
No known key found for this signature in database GPG Key ID: D83D1392AE9F93B4
2 changed files with 3 additions and 5 deletions
  1. +1
    -3
      octodns/provider/yaml.py
  2. +2
    -2
      tests/test_octodns_provider_yaml.py

+ 1
- 3
octodns/provider/yaml.py View File

@ -353,9 +353,7 @@ class YamlProvider(BaseProvider):
sources.append(join(self.directory, self.shared_filename))
if not sources:
self.log.info(
'populate: no YAMLs found for %s', zone.decoded_name
)
raise ProviderException(f'no YAMLs found for {zone.decoded_name}')
# determinstically order our sources
sources.sort()


+ 2
- 2
tests/test_octodns_provider_yaml.py View File

@ -663,8 +663,8 @@ class TestSplitYamlProvider(TestCase):
zone = Zone('empty.', [])
# without it we see everything
source.populate(zone)
self.assertEqual(0, len(zone.records))
with self.assertRaises(ProviderException):
source.populate(zone)
def test_unsorted(self):
source = SplitYamlProvider(


Loading…
Cancel
Save