1 Star 0 Fork 16

池鱼/python-blivet

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0011-iscsi-Replace-all-log_exception_info-calls-with-log.patch 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
From b938e224c41021c19775d8675dc4337f1e10d4e3 Mon Sep 17 00:00:00 2001
From: Vojtech Trefny <vtrefny@redhat.com>
Date: Wed, 1 Dec 2021 16:28:15 +0100
Subject: [PATCH] iscsi: Replace all log_exception_info calls with log.info
We don't get any useful information from the exception, it's
always the same traceback from a failed DBus call and we only use
these when a called failed because firmware ISCSI is not supported.
The resulting log message also looks like a failure with the
traceback logged and not just as a debug information.
Resolves: rhbz#2028134
---
blivet/iscsi.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
index 5ee2082b..bc77ca62 100644
--- a/blivet/iscsi.py
+++ b/blivet/iscsi.py
@@ -22,7 +22,6 @@ from . import udev
from . import util
from .flags import flags
from .i18n import _
-from .storage_log import log_exception_info
from . import safe_dbus
import os
import re
@@ -277,8 +276,8 @@ class iSCSI(object):
'org.freedesktop.DBus.ObjectManager',
'GetManagedObjects',
None)[0]
- except safe_dbus.DBusCallError:
- log_exception_info(log.info, "iscsi: Failed to get active sessions.")
+ except safe_dbus.DBusCallError as e:
+ log.info("iscsi: Failed to get active sessions: %s", str(e))
return []
sessions = (obj for obj in objects.keys() if re.match(r'.*/iscsi/session[0-9]+$', obj))
@@ -302,8 +301,8 @@ class iSCSI(object):
args = GLib.Variant("(a{sv})", ([], ))
try:
found_nodes, _n_nodes = self._call_initiator_method("DiscoverFirmware", args)
- except safe_dbus.DBusCallError:
- log_exception_info(log.info, "iscsi: No IBFT info found.")
+ except safe_dbus.DBusCallError as e:
+ log.info("iscsi: No IBFT info found: %s", str(e))
# an exception here means there is no ibft firmware, just return
return
--
2.31.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zxy19951122/python-blivet.git
git@gitee.com:zxy19951122/python-blivet.git
zxy19951122
python-blivet
python-blivet
a8

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385