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