"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "certbot/storage.py" between
certbot-0.30.2.tar.gz and certbot-0.31.0.tar.gz

About: Certbot is EFF’s tool to obtain certs from Let’s Encrypt, and optionally auto-enable HTTPS on your server. It can also act as a client for any other CA that uses the ACME protocol.

storage.py  (certbot-0.30.2):storage.py  (certbot-0.31.0)
skipping to change at line 43 skipping to change at line 43
def renewal_conf_files(config): def renewal_conf_files(config):
"""Build a list of all renewal configuration files. """Build a list of all renewal configuration files.
:param certbot.interfaces.IConfig config: Configuration object :param certbot.interfaces.IConfig config: Configuration object
:returns: list of renewal configuration files :returns: list of renewal configuration files
:rtype: `list` of `str` :rtype: `list` of `str`
""" """
return glob.glob(os.path.join(config.renewal_configs_dir, "*.conf")) result = glob.glob(os.path.join(config.renewal_configs_dir, "*.conf"))
result.sort()
return result
def renewal_file_for_certname(config, certname): def renewal_file_for_certname(config, certname):
"""Return /path/to/certname.conf in the renewal conf directory""" """Return /path/to/certname.conf in the renewal conf directory"""
path = os.path.join(config.renewal_configs_dir, "{0}.conf".format(certname)) path = os.path.join(config.renewal_configs_dir, "{0}.conf".format(certname))
if not os.path.exists(path): if not os.path.exists(path):
raise errors.CertStorageError("No certificate found with name {0} (expec ted " raise errors.CertStorageError("No certificate found with name {0} (expec ted "
"{1}).".format(certname, path)) "{1}).".format(certname, path))
return path return path
def cert_path_for_cert_name(config, cert_name): def cert_path_for_cert_name(config, cert_name):
skipping to change at line 868 skipping to change at line 870
""" """
if version is None: if version is None:
target = self.current_target("cert") target = self.current_target("cert")
else: else:
target = self.version("cert", version) target = self.version("cert", version)
if target is None: if target is None:
raise errors.CertStorageError("could not find cert file") raise errors.CertStorageError("could not find cert file")
with open(target) as f: with open(target) as f:
return crypto_util.get_names_from_cert(f.read()) return crypto_util.get_names_from_cert(f.read())
def autodeployment_is_enabled(self):
"""Is automatic deployment enabled for this cert?
If autodeploy is not specified, defaults to True.
:returns: True if automatic deployment is enabled
:rtype: bool
"""
return ("autodeploy" not in self.configuration or
self.configuration.as_bool("autodeploy"))
def should_autodeploy(self, interactive=False):
"""Should this lineage now automatically deploy a newer version?
This is a policy question and does not only depend on whether
there is a newer version of the cert. (This considers whether
autodeployment is enabled, whether a relevant newer version
exists, and whether the time interval for autodeployment has
been reached.)
:param bool interactive: set to True to examine the question
regardless of whether the renewal configuration allows
automated deployment (for interactive use). Default False.
:returns: whether the lineage now ought to autodeploy an
existing newer cert version
:rtype: bool
"""
if interactive or self.autodeployment_is_enabled():
if self.has_pending_deployment():
interval = self.configuration.get("deploy_before_expiry",
"5 days")
now = pytz.UTC.fromutc(datetime.datetime.utcnow())
if self.target_expiry < add_time_interval(now, interval):
return True
return False
def ocsp_revoked(self, version=None): def ocsp_revoked(self, version=None):
# pylint: disable=no-self-use,unused-argument # pylint: disable=no-self-use,unused-argument
"""Is the specified cert version revoked according to OCSP? """Is the specified cert version revoked according to OCSP?
Also returns True if the cert version is declared as intended Also returns True if the cert version is declared as intended
to be revoked according to Let's Encrypt OCSP extensions. to be revoked according to Let's Encrypt OCSP extensions.
(If no version is specified, uses the current version.) (If no version is specified, uses the current version.)
This method is not yet implemented and currently always returns This method is not yet implemented and currently always returns
False. False.
 End of changes. 2 change blocks. 
40 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)