From 919a5a8f0b3b0f903c048acdffa62dbb8ee42230 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sun, 17 Aug 2014 19:55:03 +0000 Subject: [PATCH] whats_next: when there are multiple responses like for NS records sort the responses so we can compare to a fixed order --- management/whats_next.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/management/whats_next.py b/management/whats_next.py index 557dce99..8d59127d 100755 --- a/management/whats_next.py +++ b/management/whats_next.py @@ -248,8 +248,9 @@ def query_dns(qname, rtype, nxdomain='[Not Set]'): # There may be multiple answers; concatenate the response. Remove trailing # periods from responses since that's how qnames are encoded in DNS but is - # confusing for us. - return "; ".join(str(r).rstrip('.') for r in response) + # confusing for us. The order of the answers doesn't matter, so sort so we + # can compare to a well known order. + return "; ".join(sorted(str(r).rstrip('.') for r in response)) def check_ssl_cert(domain, env): # Check that SSL certificate is signed.