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

Remove the rest of the . ending files, clean up code and tests for better coverage

This commit is contained in:
Ross McFarland
2021-01-28 13:24:35 -08:00
parent c06dd6f846
commit 4ce2563d2e
32 changed files with 30 additions and 23 deletions

View File

@@ -216,7 +216,7 @@ class ZoneFileSource(AxfrBaseSource):
# (optional, default true)
check_origin: false
'''
def __init__(self, id, directory, file_extension=None, check_origin=True):
def __init__(self, id, directory, file_extension='.', check_origin=True):
self.log = logging.getLogger('ZoneFileSource[{}]'.format(id))
self.log.debug('__init__: id=%s, directory=%s, file_extension=%s, '
'check_origin=%s', id,
@@ -229,12 +229,7 @@ class ZoneFileSource(AxfrBaseSource):
self._zone_records = {}
def _load_zone_file(self, zone_name):
zone_filename = zone_name
if self.file_extension:
zone_filename = '{}{}'.format(zone_name,
self.file_extension.lstrip('.'))
zone_filename = '{}{}'.format(zone_name[:-1], self.file_extension)
zonefiles = listdir(self.directory)
if zone_filename in zonefiles:
try: