Quick hack for TypeError raise in dnspython
This commit is contained in:
parent
102b2d46ab
commit
26ffcadba9
|
@ -238,8 +238,22 @@ def get_certificates_to_provision(env, show_extended_problems=True, force_domain
|
|||
except Exception as e:
|
||||
problems[domain] = "DNS isn't configured properly for this domain: DNS lookup had an error: %s." % str(e)
|
||||
return False
|
||||
if len(response) != 1 or str(response[0]) != value:
|
||||
problems[domain] = "Domain control validation cannot be performed for this domain because DNS points the domain to another machine (%s %s)." % (rtype, ", ".join(str(r) for r in response))
|
||||
|
||||
if len(response) == 1:
|
||||
try:
|
||||
response_str = str(response[0])
|
||||
except TypeError:
|
||||
response_str = response[0].to_text().decode('utf8')
|
||||
if len(response) != 1 or response_str != value:
|
||||
addresses = list()
|
||||
for r in response:
|
||||
try:
|
||||
addresses.append(str(r).rstrip('.'))
|
||||
except TypeError:
|
||||
addresses.append(r.to_text().decode('utf8').rstrip('.'))
|
||||
|
||||
err_txt = ", ".join(sorted(addresses))
|
||||
problems[domain] = "Domain control validation cannot be performed for this domain because DNS points the domain to another machine (%s %s)." % (rtype, err_txt)
|
||||
return False
|
||||
|
||||
return True
|
||||
|
|
|
@ -680,7 +680,14 @@ def query_dns(qname, rtype, nxdomain='[Not Set]', at=None):
|
|||
# periods from responses since that's how qnames are encoded in DNS but is
|
||||
# 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))
|
||||
addresses = list()
|
||||
for r in response:
|
||||
try:
|
||||
addresses.append(str(r).rstrip('.'))
|
||||
except TypeError:
|
||||
addresses.append(r.to_text().decode('utf8').rstrip('.'))
|
||||
|
||||
return "; ".join(sorted(addresses))
|
||||
|
||||
def check_ssl_cert(domain, rounded_time, ssl_certificates, env, output):
|
||||
# Check that TLS certificate is signed.
|
||||
|
|
Loading…
Reference in New Issue