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