From 1f5f9fa59c93d29a5ced58768395952b226a4709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavol=20=C5=BD=C3=A1=C4=8Dik?= Date: Thu, 11 Apr 2024 10:09:05 +0200 Subject: [PATCH] Fix logs in `commands.read_file` Print the name of the file being read instead of its descriptor. --- tuned/utils/commands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tuned/utils/commands.py b/tuned/utils/commands.py index db8d8b1..be6451d 100644 --- a/tuned/utils/commands.py +++ b/tuned/utils/commands.py @@ -124,9 +124,9 @@ class commands: def read_file(self, f, err_ret = "", no_error = False): old_value = err_ret try: - f = open(f, "r") - old_value = f.read() - f.close() + fd = open(f, "r") + old_value = fd.read() + fd.close() except (OSError,IOError) as e: if not no_error: self._error("Error when reading file '%s': '%s'" % (f, e))