14f8ab
From 6ed227367b6eb7d6d7afde3859ad0a711a3adf36 Mon Sep 17 00:00:00 2001
14f8ab
From: Leela Venkaiah G <gleelavenkaiah@gmail.com>
14f8ab
Date: Wed, 13 Jan 2021 16:02:25 +0530
14f8ab
Subject: [PATCH 519/526] glusterfs-events: Fix incorrect attribute access
14f8ab
 (#2002)
14f8ab
14f8ab
Issue: When GlusterCmdException is raised, current code try to access
14f8ab
message atrribute which doesn't exist and resulting in a malformed
14f8ab
error string on failure operations
14f8ab
14f8ab
Code Change: Replace `message` with `args[0]`
14f8ab
14f8ab
>Fixes: #2001
14f8ab
>Change-Id: I65c9f0ee79310937a384025b8d454acda154e4bb
14f8ab
>Signed-off-by: Leela Venkaiah G <lgangava@redhat.com>
14f8ab
Upstream patch: https://github.com/gluster/glusterfs/pull/2002
14f8ab
14f8ab
BUG: 1600459
14f8ab
Change-Id: I65c9f0ee79310937a384025b8d454acda154e4bb
14f8ab
Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
14f8ab
Reviewed-on: https://code.engineering.redhat.com/gerrit/223584
14f8ab
Tested-by: RHGS Build Bot <nigelb@redhat.com>
14f8ab
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
14f8ab
---
14f8ab
 events/src/peer_eventsapi.py | 8 ++++----
14f8ab
 1 file changed, 4 insertions(+), 4 deletions(-)
14f8ab
14f8ab
diff --git a/events/src/peer_eventsapi.py b/events/src/peer_eventsapi.py
14f8ab
index 26b77a0..c388da4 100644
14f8ab
--- a/events/src/peer_eventsapi.py
14f8ab
+++ b/events/src/peer_eventsapi.py
14f8ab
@@ -174,9 +174,9 @@ def sync_to_peers(args):
14f8ab
             sync_file_to_peers(WEBHOOKS_FILE_TO_SYNC)
14f8ab
         except GlusterCmdException as e:
14f8ab
             # Print stdout if stderr is empty
14f8ab
-            errmsg = e.message[2] if e.message[2] else e.message[1]
14f8ab
+            errmsg = e.args[0][2] if e.args[0][2] else e.args[0][1]
14f8ab
             handle_output_error("Failed to sync Webhooks file: [Error: {0}]"
14f8ab
-                                "{1}".format(e.message[0], errmsg),
14f8ab
+                                "{1}".format(e.args[0][0], errmsg),
14f8ab
                                 errcode=ERROR_WEBHOOK_SYNC_FAILED,
14f8ab
                                 json_output=args.json)
14f8ab
 
14f8ab
@@ -185,9 +185,9 @@ def sync_to_peers(args):
14f8ab
             sync_file_to_peers(CUSTOM_CONFIG_FILE_TO_SYNC)
14f8ab
         except GlusterCmdException as e:
14f8ab
             # Print stdout if stderr is empty
14f8ab
-            errmsg = e.message[2] if e.message[2] else e.message[1]
14f8ab
+            errmsg = e.args[0][2] if e.args[0][2] else e.args[0][1]
14f8ab
             handle_output_error("Failed to sync Config file: [Error: {0}]"
14f8ab
-                                "{1}".format(e.message[0], errmsg),
14f8ab
+                                "{1}".format(e.args[0][0], errmsg),
14f8ab
                                 errcode=ERROR_CONFIG_SYNC_FAILED,
14f8ab
                                 json_output=args.json)
14f8ab
 
14f8ab
-- 
14f8ab
1.8.3.1
14f8ab