Browse Source

[filebrowser] Check for s3a:// in remote_storage home path (#3076)

Harsh Gupta 3 years ago
parent
commit
89070a4afb
1 changed files with 4 additions and 1 deletions
  1. 4 1
      desktop/libs/aws/src/aws/s3/s3fs.py

+ 4 - 1
desktop/libs/aws/src/aws/s3/s3fs.py

@@ -89,7 +89,10 @@ def auth_error_handler(view_fn):
 def get_s3_home_directory(user=None):
 def get_s3_home_directory(user=None):
   from desktop.models import _handle_user_dir_raz
   from desktop.models import _handle_user_dir_raz
 
 
-  remote_home_s3 = REMOTE_STORAGE_HOME.get() if hasattr(REMOTE_STORAGE_HOME, 'get') and REMOTE_STORAGE_HOME.get() else 's3a://'
+  remote_home_s3 = 's3a://'
+  if hasattr(REMOTE_STORAGE_HOME, 'get') and REMOTE_STORAGE_HOME.get() and REMOTE_STORAGE_HOME.get().startswith('s3a://'):
+    remote_home_s3 = REMOTE_STORAGE_HOME.get()
+
   remote_home_s3 = _handle_user_dir_raz(user, remote_home_s3)
   remote_home_s3 = _handle_user_dir_raz(user, remote_home_s3)
 
 
   return remote_home_s3
   return remote_home_s3