]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/dashboard: silence lint warnings 21293/head
authorKefu Chai <kchai@redhat.com>
Wed, 11 Apr 2018 14:41:01 +0000 (22:41 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 11 Apr 2018 14:41:03 +0000 (22:41 +0800)
this silences following errors:

9: ./awsauth.py:42:1: E722 do not use bare except'
9: ./awsauth.py:116:13: E722 do not use bare except'

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/dashboard/awsauth.py

index 123d6282519b9d5d53f4bd4b38bdb4bb77ead9da..3fafcd75f4d12124cef07ba48f166025e7140027 100644 (file)
@@ -39,7 +39,7 @@ py3k = False
 try:
     from urlparse import urlparse, unquote
     from base64 import encodestring
-except:
+except ImportError:
     py3k = True
     from urllib.parse import urlparse, unquote
     from base64 import encodebytes as encodestring
@@ -113,7 +113,7 @@ class S3Auth(AuthBase):
             lk = key.lower()
             try:
                 lk = lk.decode('utf-8')
-            except:
+            except UnicodeDecodeError:
                 pass
             if headers[key] and (lk in interesting_headers.keys()
                                  or lk.startswith('x-amz-')):