From 7f332a396299825eb078c8935449b816ce613d6d Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Fri, 27 Apr 2018 12:38:41 +0100 Subject: [PATCH] mgr/dashboard: awsauth: fix python3 string decode problem Signed-off-by: Ricardo Dias --- src/pybind/mgr/dashboard/awsauth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/awsauth.py b/src/pybind/mgr/dashboard/awsauth.py index 3fafcd75f4d..fdf87de6137 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()