mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Merge branch 'main' into rc-version-fix
This commit is contained in:
@@ -475,7 +475,6 @@ class Manager(object):
|
||||
force=False,
|
||||
plan_output_fh=stdout,
|
||||
):
|
||||
|
||||
self.log.info(
|
||||
'sync: eligible_zones=%s, eligible_targets=%s, dry_run=%s, '
|
||||
'force=%s, plan_output_fh=%s',
|
||||
|
||||
@@ -61,8 +61,13 @@ class AutoArpa(BaseProcessor):
|
||||
zone,
|
||||
name,
|
||||
{'ttl': self.ttl, 'type': 'PTR', 'values': fqdns},
|
||||
lenient=lenient,
|
||||
)
|
||||
zone.add_record(
|
||||
record,
|
||||
replace=self.populate_should_replace,
|
||||
lenient=lenient,
|
||||
)
|
||||
zone.add_record(record, replace=self.populate_should_replace)
|
||||
|
||||
self.log.info(
|
||||
'populate: found %s records', len(zone.records) - before
|
||||
|
||||
@@ -78,7 +78,6 @@ class Plan(object):
|
||||
self.existing
|
||||
and len(self.existing.records) >= self.MIN_EXISTING_RECORDS
|
||||
):
|
||||
|
||||
existing_record_count = len(self.existing.records)
|
||||
if existing_record_count > 0:
|
||||
update_pcent = (
|
||||
|
||||
@@ -41,6 +41,10 @@ class Record(EqualityTupleMixin):
|
||||
# convert the error into a reason
|
||||
reasons.append(str(e))
|
||||
name = str(name)
|
||||
|
||||
if ' ' in name or '\t' in name:
|
||||
reasons.append('invalid record, whitespace is not allowed')
|
||||
|
||||
fqdn = f'{name}.{zone.name}' if name else zone.name
|
||||
try:
|
||||
_type = data['type']
|
||||
|
||||
@@ -13,7 +13,7 @@ class ValidationError(RecordException):
|
||||
@classmethod
|
||||
def build_message(cls, fqdn, reasons):
|
||||
reasons = '\n - '.join(reasons)
|
||||
return f'Invalid record {idna_decode(fqdn)}\n - {reasons}'
|
||||
return f'Invalid record "{idna_decode(fqdn)}"\n - {reasons}'
|
||||
|
||||
def __init__(self, fqdn, reasons):
|
||||
super().__init__(self.build_message(fqdn, reasons))
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
|
||||
class BaseSource(object):
|
||||
|
||||
SUPPORTS_MULTIVALUE_PTR = False
|
||||
SUPPORTS_POOL_VALUE_STATUS = False
|
||||
SUPPORTS_ROOT_NS = False
|
||||
|
||||
@@ -28,6 +28,9 @@ class Zone(object):
|
||||
def __init__(self, name, sub_zones):
|
||||
if not name[-1] == '.':
|
||||
raise Exception(f'Invalid zone name {name}, missing ending dot')
|
||||
elif ' ' in name or '\t' in name:
|
||||
raise Exception(f'Invalid zone name {name}, whitespace not allowed')
|
||||
|
||||
# internally everything is idna
|
||||
self.name = idna_encode(str(name)) if name else name
|
||||
# we'll keep a decoded version around for logs and errors
|
||||
|
||||
Reference in New Issue
Block a user