add --replace-all argument to ssl_certificates.py

This commit is contained in:
Scott Bronson 2015-12-18 17:58:59 -08:00
parent 91d7151101
commit e09230192f
1 changed files with 5 additions and 2 deletions

View File

@ -182,10 +182,13 @@ def get_certificates_to_provision(env):
domains.add(domain)
else:
cert = cert["certificate_object"]
import sys
if cert.issuer == cert.subject:
# This is self-signed. Get a real one.
domains.add(domain)
elif "--replace-all" in sys.argv:
domains.add(domain)
# Valid certificate today, but is it expiring soon?
elif cert.not_valid_after-now < datetime.timedelta(days=14):
domains.add(domain)
@ -709,4 +712,4 @@ def get_certificate_domains(cert):
if __name__ == "__main__":
# Provision certificates.
provision_certificates_cmdline()
provision_certificates_cmdline()