ssh: fix unclosed file

This commit is contained in:
Dan Bungert 2024-02-07 22:45:06 -07:00
parent b6f8cf334f
commit 47256905a4
1 changed files with 2 additions and 2 deletions

View File

@ -88,8 +88,8 @@ def host_key_info(runtime_state_dir=None):
host_fingerprints.is_file(), host_fingerprints.is_file(),
) )
if host_fingerprints.is_file(): if host_fingerprints.is_file():
fingerprints = open(host_fingerprints, "r") with open(host_fingerprints, "r") as fp:
return fingerprints.read() return fp.read()
return summarize_host_keys(host_key_fingerprints()) return summarize_host_keys(host_key_fingerprints())