b51a1f
From baeca3c9b70548463ceea0ae27e6f98cf06e96b7 Mon Sep 17 00:00:00 2001
b51a1f
From: srijan-sivakumar <ssivakum@redhat.com>
b51a1f
Date: Tue, 28 Jul 2020 22:27:34 +0530
b51a1f
Subject: [PATCH 526/526] Quota quota_fsck.py, converting byte string to string
b51a1f
b51a1f
Issue: The quota_fsck.py script throws an TypeError
b51a1f
due to the fact that the data is read as bytes and then
b51a1f
the string operations are applied on the. Now, in python3
b51a1f
string is unicode and hence we get the type error.
b51a1f
b51a1f
Code Changes:
b51a1f
Decoding the bytes value into utf-8 format.
b51a1f
b51a1f
>Change-Id: Ia1ff52a821d664a371c8166692ff506ae39f6e40
b51a1f
>Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
b51a1f
>Fixes: #1401
b51a1f
Upstream patch: https://review.gluster.org/c/glusterfs/+/24785
b51a1f
b51a1f
BUG: 1719171
b51a1f
Change-Id: Ia1ff52a821d664a371c8166692ff506ae39f6e40
b51a1f
Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
b51a1f
Reviewed-on: https://code.engineering.redhat.com/gerrit/224780
b51a1f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
b51a1f
Reviewed-by: Kshithij Iyer <kiyer@redhat.com>
b51a1f
Reviewed-by: Rinku Kothiya <rkothiya@redhat.com>
b51a1f
---
b51a1f
 extras/quota/quota_fsck.py | 1 +
b51a1f
 1 file changed, 1 insertion(+)
b51a1f
b51a1f
diff --git a/extras/quota/quota_fsck.py b/extras/quota/quota_fsck.py
b51a1f
index 174f2a2..ea8d638 100755
b51a1f
--- a/extras/quota/quota_fsck.py
b51a1f
+++ b/extras/quota/quota_fsck.py
b51a1f
@@ -157,6 +157,7 @@ def get_quota_xattr_brick(dpath):
b51a1f
     xattr_dict['parents'] = {}
b51a1f
 
b51a1f
     for xattr in pairs:
b51a1f
+        xattr = xattr.decode("utf-8")
b51a1f
         xattr_key = xattr.split("=")[0]
b51a1f
         if re.search("# file:", xattr_key):
b51a1f
             # skip the file comment
b51a1f
-- 
b51a1f
1.8.3.1
b51a1f