SJS Sort rrset members by content before comparison to ensure correct compare. Also default comment to blank entry rather than missing entry, to allow sorting to work correctly.

This commit is contained in:
Steve Shipway
2020-05-20 16:21:28 +12:00
parent 0ef132a7be
commit 3476c8a9ec
2 changed files with 29 additions and 5 deletions

View File

@ -99,14 +99,17 @@ def domain(domain_name):
# PDA jinja2 template can understand.
index = 0
for record in r['records']:
if (len(r['comments'])>index):
c=r['comments'][index]['content']
else:
c=''
record_entry = RecordEntry(
name=r_name,
type=r['type'],
status='Disabled' if record['disabled'] else 'Active',
ttl=r['ttl'],
data=record['content'],
comment=r['comments'][index]['content']
if r['comments'] else '',
comment=c,
is_allowed_edit=True)
index += 1
records.append(record_entry)