8 Star 0 Fork 5

src-anolis-os/glusterfs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0519-glusterfs-events-Fix-incorrect-attribute-access-2002.patch 2.51 KB
一键复制 编辑 原始数据 按行查看 历史
renbo02 提交于 2021-12-27 14:44 . update to glusterfs-6.0-56.4.el8
From 6ed227367b6eb7d6d7afde3859ad0a711a3adf36 Mon Sep 17 00:00:00 2001
From: Leela Venkaiah G <[email protected]>
Date: Wed, 13 Jan 2021 16:02:25 +0530
Subject: [PATCH 519/526] glusterfs-events: Fix incorrect attribute access
(#2002)
Issue: When GlusterCmdException is raised, current code try to access
message atrribute which doesn't exist and resulting in a malformed
error string on failure operations
Code Change: Replace `message` with `args[0]`
>Fixes: #2001
>Change-Id: I65c9f0ee79310937a384025b8d454acda154e4bb
>Signed-off-by: Leela Venkaiah G <[email protected]>
Upstream patch: https://github.com/gluster/glusterfs/pull/2002
BUG: 1600459
Change-Id: I65c9f0ee79310937a384025b8d454acda154e4bb
Signed-off-by: srijan-sivakumar <[email protected]>
Reviewed-on: https://code.engineering.redhat.com/gerrit/223584
Tested-by: RHGS Build Bot <[email protected]>
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <[email protected]>
---
events/src/peer_eventsapi.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/events/src/peer_eventsapi.py b/events/src/peer_eventsapi.py
index 26b77a0..c388da4 100644
--- a/events/src/peer_eventsapi.py
+++ b/events/src/peer_eventsapi.py
@@ -174,9 +174,9 @@ def sync_to_peers(args):
sync_file_to_peers(WEBHOOKS_FILE_TO_SYNC)
except GlusterCmdException as e:
# Print stdout if stderr is empty
- errmsg = e.message[2] if e.message[2] else e.message[1]
+ errmsg = e.args[0][2] if e.args[0][2] else e.args[0][1]
handle_output_error("Failed to sync Webhooks file: [Error: {0}]"
- "{1}".format(e.message[0], errmsg),
+ "{1}".format(e.args[0][0], errmsg),
errcode=ERROR_WEBHOOK_SYNC_FAILED,
json_output=args.json)
@@ -185,9 +185,9 @@ def sync_to_peers(args):
sync_file_to_peers(CUSTOM_CONFIG_FILE_TO_SYNC)
except GlusterCmdException as e:
# Print stdout if stderr is empty
- errmsg = e.message[2] if e.message[2] else e.message[1]
+ errmsg = e.args[0][2] if e.args[0][2] else e.args[0][1]
handle_output_error("Failed to sync Config file: [Error: {0}]"
- "{1}".format(e.message[0], errmsg),
+ "{1}".format(e.args[0][0], errmsg),
errcode=ERROR_CONFIG_SYNC_FAILED,
json_output=args.json)
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/glusterfs.git
[email protected]:src-anolis-os/glusterfs.git
src-anolis-os
glusterfs
glusterfs
a8

搜索帮助