1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Merge branch 'main' into certifi-bump

This commit is contained in:
Ross McFarland
2022-12-13 10:16:22 -08:00
committed by GitHub
2 changed files with 9 additions and 2 deletions

View File

@@ -12,6 +12,8 @@
#### Stuff
* Added simple IgnoreRootNsFilter
* Minor refactor on YamlProvider to add get_filenames making it a bit easier to
create specialized providers inheriting from it
## v0.9.21 - 2022-10-16 - Last of the oughts

View File

@@ -183,6 +183,12 @@ class YamlProvider(BaseProvider):
'_populate_from_file: successfully loaded "%s"', filename
)
def get_filenames(self, zone):
return (
join(self.directory, f'{zone.decoded_name}yaml'),
join(self.directory, f'{zone.name}yaml'),
)
def populate(self, zone, target=False, lenient=False):
self.log.debug(
'populate: name=%s, target=%s, lenient=%s',
@@ -197,8 +203,7 @@ class YamlProvider(BaseProvider):
return False
before = len(zone.records)
utf8_filename = join(self.directory, f'{zone.decoded_name}yaml')
idna_filename = join(self.directory, f'{zone.name}yaml')
utf8_filename, idna_filename = self.get_filenames(zone)
# we prefer utf8
if isfile(utf8_filename):