From 462d58bb2ee8afa63c687d05982c129a58dfa86c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 27 Jun 2017 14:43:15 -0400 Subject: [PATCH] le-renew: try all certs even if one fails --- .bin/le-renew | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.bin/le-renew b/.bin/le-renew index acc9567..cc008aa 100755 --- a/.bin/le-renew +++ b/.bin/le-renew @@ -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) -- 2.39.5