Commit dda4f7ec authored by ale's avatar ale

Ignore non-string non-list values

Might be present in legacy configuration files, they serve
no purpose in zonetool.
parent b1b40111
Pipeline #3349 passed with stages
in 1 minute and 25 seconds
...@@ -67,8 +67,11 @@ def _to_records(data): ...@@ -67,8 +67,11 @@ def _to_records(data):
# Uppercase keys are attributes, lowercase are DNS records. # Uppercase keys are attributes, lowercase are DNS records.
if key.isupper(): if key.isupper():
continue continue
if not isinstance(values, list): if isinstance(values, basestring):
values = [values] values = [values]
elif not isinstance(values, list):
# Ignore values of other types (bools?)
continue
for value in values: for value in values:
rtype, rdata = _parse_record(value) rtype, rdata = _parse_record(value)
records.append(('' if key == '_' else key, rtype, rdata)) records.append(('' if key == '_' else key, rtype, rdata))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment