Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/management/status_checks.py b/management/status_checks.py
- index 13cbab1..d9ce484 100755
- --- a/management/status_checks.py
- +++ b/management/status_checks.py
- @@ -472,7 +472,7 @@ def check_dns_zone(domain, env, output, dns_zonefiles):
- % (existing_ns, correct_ns) )
- # Check that each custom secondary nameserver resolves the IP address.
- -
- +
- if custom_secondary_ns and not probably_external_dns:
- for ns in custom_secondary_ns:
- # We must first resolve the nameserver to an IP address so we can query it.
- @@ -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))
- + arr = []
- + for r in response:
- + s = r.to_text()
- + if isinstance(s, bytes):
- + s = s.decode('utf-8')
- + arr.append(s)
- +
- + return "; ".join(sorted(str(r).rstrip('.') for r in arr))
- def check_ssl_cert(domain, rounded_time, ssl_certificates, env, output):
- # Check that TLS certificate is signed.
- @@ -897,7 +904,7 @@ class FileOutput:
- class ConsoleOutput(FileOutput):
- def __init__(self):
- self.buf = sys.stdout
- -
- +
- # Do nice line-wrapping according to the size of the terminal.
- # The 'stty' program queries standard input for terminal information.
- if sys.stdin.isatty():
- diff --git a/management/ssl_certificates.py b/management/ssl_certificates.py
- index c49443b..8d2683e 100755
- --- a/management/ssl_certificates.py
- +++ b/management/ssl_certificates.py
- @@ -196,7 +196,7 @@ def get_certificates_to_provision(env, show_extended_problems=True, force_domain
- if cert.issuer == cert.subject:
- # This is self-signed. Get a real one.
- domains.add(domain)
- -
- +
- # Valid certificate today, but is it expiring soon?
- elif cert.not_valid_after-now < datetime.timedelta(days=14):
- domains.add(domain)
- @@ -238,7 +238,12 @@ 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:
- +
- + response_arr = [response[0]]
- + if isinstance(response[0].to_text(), bytes):
- + response_arr[0] = response[0].to_text().decode('utf-8')
- +
- + if len(response) != 1 or str(response_arr[0]) != value:
- problems[domain] = "Domain control validation cannot be performed for this domain because DNS points the domain to another machine (%s %s)." % (r
- return False
- @@ -406,7 +411,7 @@ def provision_certificates_cmdline():
- headless = False
- force_domains = None
- show_extended_problems = True
- -
- +
- args = list(sys.argv)
- args.pop(0) # program name
- if args and args[0] == "-v":
- @@ -488,7 +493,7 @@ control panel.
- Do you agree to the agreement? Type Y or N and press <ENTER>: """
- % request["url"], end='', flush=True)
- -
- +
- if sys.stdin.readline().strip().upper() != "Y":
- print("\nYou didn't agree. Quitting.")
- sys.exit(1)
Advertisement
Add Comment
Please, Sign In to add comment