mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:02:52 +02:00
Keep storage.names() from passing None to open()
Fixes exiting abnormally with:
TypeError: coercing to Unicode: need string or buffer, NoneType found
This commit is contained in:
@@ -450,12 +450,15 @@ class RenewableCert(object): # pylint: disable=too-many-instance-attributes
|
|||||||
:param int version: the desired version number
|
:param int version: the desired version number
|
||||||
:returns: the subject names
|
:returns: the subject names
|
||||||
:rtype: `list` of `str`
|
:rtype: `list` of `str`
|
||||||
|
:raises .CertStorageError: if could not find cert file.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
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:
|
||||||
|
raise errors.CertStorageError("could not find cert file")
|
||||||
with open(target) as f:
|
with open(target) as f:
|
||||||
return crypto_util.get_sans_from_cert(f.read())
|
return crypto_util.get_sans_from_cert(f.read())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user