瀏覽代碼

[aws] Avoid 500 as S3ListAllBucketsException does not have a message attribute

Romain Rigaux 4 年之前
父節點
當前提交
d0449d3703

+ 2 - 2
apps/filebrowser/src/filebrowser/views.py

@@ -513,7 +513,7 @@ def listdir_paged(request, path):
     else:
       all_stats = request.fs.listdir_stats(path)
   except S3ListAllBucketsException as e:
-    s3_listing_not_allowed = e.message
+    s3_listing_not_allowed = str(e)
     all_stats = []
 
 
@@ -966,7 +966,7 @@ def detect_gzip(contents):
   if sys.version_info[0] > 2:
     return contents[:2] == b'\x1f\x8b'
   else:
-    return contents[:2] == '\x1f\x8b' 
+    return contents[:2] == '\x1f\x8b'
 
 
 def detect_bz2(contents):

+ 1 - 1
desktop/core/src/desktop/lib/raz/ranger/clients/ranger_raz_client.py

@@ -113,7 +113,7 @@ class RangerRazClient:
   def check_privileges(self, raz_requests, doAsUser=None):
     resp = self.__call_api(
       RangerRazClient.CHECK_PRIVILEGES.format_path(
-        {"serviceType": raz_request.serviceType}
+        {"serviceType": raz_requests.serviceType}
       ),
       query_params=self.__get_query_params(None, doAsUser),
       request_data=raz_requests,