expiry = cert.get_expiration_date()
if expiry and expiry > time.time():
- log.warn('certificate is still valid, revoking previous version')
+ log.warn('certificate is still valid')
+
+ if cert.exists():
+ log.warn('revoking previous version')
self.revoke(cert)
log.info('generating new certificate %s', cert.name)