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)