From f7bfa8ff42569a36d1a6c326adbe2eb24415ed5f Mon Sep 17 00:00:00 2001 From: David Ferreira de Sousa Duque Date: Thu, 15 Oct 2020 11:22:27 +0100 Subject: [PATCH] Display dates in ISO format --- management/backup.py | 2 +- management/ssl_certificates.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/management/backup.py b/management/backup.py index e1651552..008efda2 100755 --- a/management/backup.py +++ b/management/backup.py @@ -51,7 +51,7 @@ def backup_status(env): date = dateutil.parser.parse(keys[1]).astimezone(dateutil.tz.tzlocal()) return { "date": keys[1], - "date_str": date.strftime("%Y-%m-%d %X") + " " + now.tzname(), + "date_str": date.isoformat() + " (" + now.tzname() + ")", "date_delta": reldate(date, now, "the future?"), "full": keys[0] == "full", "size": 0, # collection-status doesn't give us the size diff --git a/management/ssl_certificates.py b/management/ssl_certificates.py index 1b1e9f83..3e1b5856 100755 --- a/management/ssl_certificates.py +++ b/management/ssl_certificates.py @@ -216,12 +216,12 @@ def get_certificates_to_provision(env, limit_domains=None, show_valid_certs=True response = query_dns(domain, rtype) if response != normalize_ip(value): bad_dns.append("%s (%s)" % (response, rtype)) - + if bad_dns: domains_cant_provision[domain] = "The domain name does not resolve to this machine: " \ + (", ".join(bad_dns)) \ + "." - + else: # DNS is all good. @@ -606,10 +606,10 @@ def check_certificate(domain, ssl_certificate, ssl_private_key, warn_if_expiring ndays = (cert_expiration_date-now).days if not rounded_time or ndays <= 10: # Yikes better renew soon! - expiry_info = "The certificate expires in %d days on %s." % (ndays, cert_expiration_date.strftime("%x")) + expiry_info = "The certificate expires in %d days on %s." % (ndays, cert_expiration_date.date().isoformat()) else: # We'll renew it with Lets Encrypt. - expiry_info = "The certificate expires on %s." % cert_expiration_date.strftime("%x") + expiry_info = "The certificate expires on %s." % cert_expiration_date.date().isoformat() if warn_if_expiring_soon and ndays <= warn_if_expiring_soon: # Warn on day 10 to give 4 days for us to automatically renew the