neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone

Blame SOURCES/0015-iscsi-Replace-all-log_exception_info-calls-with-log.patch

f2ecff
From 23b7573557e69d9b4dccdd6d52e82b82d8dba115 Mon Sep 17 00:00:00 2001
f2ecff
From: Vojtech Trefny <vtrefny@redhat.com>
f2ecff
Date: Wed, 1 Dec 2021 16:28:15 +0100
f2ecff
Subject: [PATCH] iscsi: Replace all log_exception_info calls with log.info
f2ecff
f2ecff
We don't get any useful information from the exception, it's
f2ecff
always the same traceback from a failed DBus call and we only use
f2ecff
these when a called failed because firmware ISCSI is not supported.
f2ecff
The resulting log message also looks like a failure with the
f2ecff
traceback logged and not just as a debug information.
f2ecff
f2ecff
Resolves: rhbz#2028134
f2ecff
---
f2ecff
 blivet/iscsi.py | 9 ++++-----
f2ecff
 1 file changed, 4 insertions(+), 5 deletions(-)
f2ecff
f2ecff
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
f2ecff
index 5ee2082b..bc77ca62 100644
f2ecff
--- a/blivet/iscsi.py
f2ecff
+++ b/blivet/iscsi.py
f2ecff
@@ -22,7 +22,6 @@ from . import udev
f2ecff
 from . import util
f2ecff
 from .flags import flags
f2ecff
 from .i18n import _
f2ecff
-from .storage_log import log_exception_info
f2ecff
 from . import safe_dbus
f2ecff
 import os
f2ecff
 import re
f2ecff
@@ -277,8 +276,8 @@ class iSCSI(object):
f2ecff
                                           'org.freedesktop.DBus.ObjectManager',
f2ecff
                                           'GetManagedObjects',
f2ecff
                                           None)[0]
f2ecff
-        except safe_dbus.DBusCallError:
f2ecff
-            log_exception_info(log.info, "iscsi: Failed to get active sessions.")
f2ecff
+        except safe_dbus.DBusCallError as e:
f2ecff
+            log.info("iscsi: Failed to get active sessions: %s", str(e))
f2ecff
             return []
f2ecff
 
f2ecff
         sessions = (obj for obj in objects.keys() if re.match(r'.*/iscsi/session[0-9]+$', obj))
f2ecff
@@ -302,8 +301,8 @@ class iSCSI(object):
f2ecff
         args = GLib.Variant("(a{sv})", ([], ))
f2ecff
         try:
f2ecff
             found_nodes, _n_nodes = self._call_initiator_method("DiscoverFirmware", args)
f2ecff
-        except safe_dbus.DBusCallError:
f2ecff
-            log_exception_info(log.info, "iscsi: No IBFT info found.")
f2ecff
+        except safe_dbus.DBusCallError as e:
f2ecff
+            log.info("iscsi: No IBFT info found: %s", str(e))
f2ecff
             # an exception here means there is no ibft firmware, just return
f2ecff
             return
f2ecff
 
f2ecff
-- 
f2ecff
2.31.1
f2ecff