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