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

Add comments and use list comprehensions

Per PR review, use list comprehensions as they are prefered in py3 over
use of filter.

Add comments to describe the building of the zone tree.
This commit is contained in:
Sachi King
2022-06-27 10:50:05 +10:00
parent 5592f5da96
commit d5363e8045
2 changed files with 14 additions and 6 deletions

View File

@@ -69,8 +69,7 @@ class Zone(object):
name = record.name
if not lenient and any(map(lambda sz: name.endswith(sz),
self.sub_zones)):
if not lenient and any((name.endswith(sz) for sz in self.sub_zones)):
if name not in self.sub_zones:
# it's a record for something under a sub-zone
raise SubzoneRecordException(f'Record {record.fqdn} is under '