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