dnsdisc.py: drop timestamps, sort old records

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-09-14 21:11:18 +02:00
parent 41b57c5ace
commit 0a34be547e
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
1 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ HELP_DESCRIPTION='This a utility for generating DNS Discovery records'
HELP_EXAMPLE='Example: ./dnsdisc.py -p 123abc -d nodes.example.org'
# Setup logging.
log_format = '%(asctime)s [%(levelname)s] %(message)s'
log_format = '[%(levelname)s] %(message)s'
logging.basicConfig(level=logging.INFO, format=log_format)
LOG = logging.getLogger(__name__)
@ -204,7 +204,7 @@ def main():
LOG.debug('Querying TXT DNS records: %s', opts.domain)
old_records = cf.txt_records(opts.domain)
for record in old_records:
for record in sorted(old_records):
LOG.info('Deleting record: %s', record['name'])
if not opts.dry_run:
cf.delete(record['id'])