From 47256905a4fec41f849699bde76ba7d8056a1dfc Mon Sep 17 00:00:00 2001 From: Dan Bungert Date: Wed, 7 Feb 2024 22:45:06 -0700 Subject: [PATCH] ssh: fix unclosed file --- subiquitycore/ssh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subiquitycore/ssh.py b/subiquitycore/ssh.py index 6a033b34..846b76f8 100644 --- a/subiquitycore/ssh.py +++ b/subiquitycore/ssh.py @@ -88,8 +88,8 @@ def host_key_info(runtime_state_dir=None): host_fingerprints.is_file(), ) if host_fingerprints.is_file(): - fingerprints = open(host_fingerprints, "r") - return fingerprints.read() + with open(host_fingerprints, "r") as fp: + return fp.read() return summarize_host_keys(host_key_fingerprints())