fix(keyringctl): avoid walking non existing paths to resolve certs

This commit is contained in:
Levente Polyak 2021-10-23 16:40:32 +02:00
parent 02605edee5
commit cced93480c
No known key found for this signature in database
GPG Key ID: FC1B547C8D8172C8

View File

@ -161,6 +161,8 @@ def get_cert_paths(paths: Iterable[Path]) -> Set[Path]:
visit: List[Path] = list(paths) visit: List[Path] = list(paths)
while visit: while visit:
path = visit.pop() path = visit.pop()
if not path.exists():
continue
# this level contains a certificate, abort depth search # this level contains a certificate, abort depth search
if list(path.glob("*.asc")): if list(path.glob("*.asc")):
cert_paths.add(path) cert_paths.add(path)