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