mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:02:52 +02:00
* certbot: Update storage.get_link_target (#4750) * The `get_link_target` function raises `errors.CertStorageError` when link does not exists. * certbot: Fix typo in storage.get_link_target.
This commit is contained in:
@@ -186,8 +186,15 @@ def get_link_target(link):
|
|||||||
:returns: Absolute path to the target of link
|
:returns: Absolute path to the target of link
|
||||||
:rtype: str
|
:rtype: str
|
||||||
|
|
||||||
|
:raises .CertStorageError: If link does not exists.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
target = os.readlink(link)
|
target = os.readlink(link)
|
||||||
|
except OSError:
|
||||||
|
raise errors.CertStorageError(
|
||||||
|
"Expected {0} to be a symlink".format(link))
|
||||||
|
|
||||||
if not os.path.isabs(target):
|
if not os.path.isabs(target):
|
||||||
target = os.path.join(os.path.dirname(link), target)
|
target = os.path.join(os.path.dirname(link), target)
|
||||||
return os.path.abspath(target)
|
return os.path.abspath(target)
|
||||||
|
|||||||
Reference in New Issue
Block a user