]> git.wh0rd.org - home.git/commitdiff
le-renew: try all certs even if one fails
authorMike Frysinger <vapier@gentoo.org>
Tue, 27 Jun 2017 18:43:15 +0000 (14:43 -0400)
committerMike Frysinger <vapier@gentoo.org>
Tue, 27 Jun 2017 18:43:15 +0000 (14:43 -0400)
.bin/le-renew

index acc95678ef38c016e7b4aa0bc1d8bc195ed74239..cc008aab58a62ce7ba773358050b13f2c731ae91 100755 (executable)
@@ -137,16 +137,23 @@ def process_domain(domain, dry_run=False):
         cmd += ['-d', d]
     if delta.days < 30:
         logging.info('%s: renewing', domain)
-        logging.info('%s: %s', domain, cmd)
+        logging.info('%s: %s', domain, ' '.join(cmd))
         if not dry_run:
-            subprocess.check_call(cmd)
+            try:
+                subprocess.check_call(cmd)
+            except subprocess.CalledProcessError:
+                logging.error('failed', exc_info=True)
+                return 0
             ret = 1
         # Try to revoke the old one.
         cmd = ['certbot', 'revoke', '--cert-path', cert_path]
         logging.info('%s: revoking old cert', domain)
         logging.info('%s: %s', domain, cmd)
         if not dry_run:
-            subprocess.check_call(cmd)
+            try:
+                subprocess.check_call(cmd)
+            except subprocess.CalledProcessError:
+                logging.error('failed', exc_info=True)
     else:
         logging.info('%s: up-to-date!', domain)