'Should we now try to autorenew the most recent cert version?
This is a policy question and does not only depend on whether
the cert is expired. (This considers whether autorenewal is
enabled, whether the cert is revoked, and whether the time
interval for autorenewal has been reached.)
Note that this examines the numerically most recent cert version,
not the currently deployed version.
:param bool interactive: set to True to examine the question
regardless of whether the renewal configuration allows
automated renewal (for interactive use). Default False.
:returns: whether an attempt should now be made to autorenew the
most current cert version in this lineage
:rtype: bool'

def should_autorenew(self, interactive=False):

    if (interactive or self.autorenewal_is_enabled()):
        if self.ocsp_revoked(self.latest_common_version()):
            logger.debug('Should    renew,    certificate    is    revoked.')
            return True
        default_interval = constants.RENEWER_DEFAULTS['renew_before_expiry']
        interval = self.configuration.get('renew_before_expiry', default_interval)
        expiry = crypto_util.notAfter(self.version('cert', self.latest_common_version()))
        now = pytz.UTC.fromutc(datetime.datetime.utcnow())
        if (expiry < add_time_interval(now, interval)):
            logger.debug('Should    renew,    less    than    %s    before    certificate    expiry    %s.', interval, expiry.strftime('%Y-%m-%d    %H:%M:%S    %Z'))
            return True
    return False
