From: Mike Frysinger Date: Tue, 27 Jun 2017 18:43:15 +0000 (-0400) Subject: le-renew: try all certs even if one fails X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=462d58bb2ee8afa63c687d05982c129a58dfa86c;p=home.git le-renew: try all certs even if one fails --- 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)