]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: awsauth: fix python3 string decode problem 21875/head
authorRicardo Dias <rdias@suse.com>
Fri, 27 Apr 2018 11:38:41 +0000 (12:38 +0100)
committerRicardo Dias <rdias@suse.com>
Tue, 8 May 2018 08:15:24 +0000 (09:15 +0100)
Signed-off-by: Ricardo Dias <rdias@suse.com>
(cherry picked from commit 7f332a396299825eb078c8935449b816ce613d6d)

src/pybind/mgr/dashboard/awsauth.py

index 3fafcd75f4d12124cef07ba48f166025e7140027..fdf87de61377d94141de6395ef919f49560ade7d 100644 (file)
@@ -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()