Split out runnable renewer into separate file

This commit is contained in:
Seth Schoen 2015-04-22 12:36:57 -07:00
parent b13b6de79f
commit cdf8ccbd34
2 changed files with 16 additions and 11 deletions

View file

@ -1,5 +1,3 @@
#!/usr/bin/env python
"""Renewer tool to handle autorenewal and autodeployment of renewed
certs within lineages of successor certificates, according to
configuration."""
@ -452,12 +450,3 @@ def main(config=DEFAULTS):
renew(cert, old_version)
notify.notify("Autorenewed a cert!!!", "root", "It worked!")
# TODO: explain what happened
if __name__ == "__main__":
if ("renewer_enabled" in DEFAULTS
and not DEFAULTS.as_bool("renewer_enabled")):
print "Renewer is disabled by configuration! Exiting."
raise SystemExit
else:
main()

16
letsencrypt/scripts/renewer.py Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env python
from letsencrypt.client import renewer
DEFAULTS = configobj.ConfigObj("renewal.conf")
DEFAULTS["renewal_configs_dir"] = "/tmp/etc/letsencrypt/configs"
DEFAULTS["official_archive_dir"] = "/tmp/etc/letsencrypt/archive"
DEFAULTS["live_dir"] = "/tmp/etc/letsencrypt/live"
if __name__ == 'main':
if ("renewer_enabled" in DEFAULTS
and not DEFAULTS.as_bool("renewer_enabled")):
print "Renewer is disabled by configuration! Exiting."
raise SystemExit
else:
renewer.main()