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