From: Ricardo Dias Date: Fri, 27 Apr 2018 11:38:41 +0000 (+0100) Subject: mgr/dashboard: awsauth: fix python3 string decode problem X-Git-Tag: v13.1.1~45^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21875%2Fhead;p=ceph.git mgr/dashboard: awsauth: fix python3 string decode problem Signed-off-by: Ricardo Dias (cherry picked from commit 7f332a396299825eb078c8935449b816ce613d6d) --- diff --git a/src/pybind/mgr/dashboard/awsauth.py b/src/pybind/mgr/dashboard/awsauth.py index 3fafcd75f4d1..fdf87de61377 100644 --- a/src/pybind/mgr/dashboard/awsauth.py +++ b/src/pybind/mgr/dashboard/awsauth.py @@ -112,7 +112,8 @@ class S3Auth(AuthBase): for key in headers: lk = key.lower() try: - lk = lk.decode('utf-8') + if isinstance(lk, bytes): + lk = lk.decode('utf-8') except UnicodeDecodeError: pass if headers[key] and (lk in interesting_headers.keys()