Ver Fonte

[ozone] Better naming for abspath var and using rename API for rename operation (#3225)

Ayush Goyal há 2 anos atrás
pai
commit
05f50b3d00

+ 5 - 5
desktop/core/src/desktop/lib/fs/ozone/__init__.py

@@ -46,18 +46,18 @@ def normpath(path):
   return normalized
 
 
-def abspath(cd, uri):
+def abspath(path, key):
   """
   Returns absolute URI, examples:
 
   abspath('ofs://volume/bucket/key', key2') == 'ofs://volume/bucket/key/key2'
   abspath('ofs://volume/bucket/key', 'ofs://volume/bucket2/key2') == 'ofs://volume/bucket2/key2'
   """
-  if cd.lower().startswith(OFS_ROOT):
-    uri = join(cd, uri)
+  if path.lower().startswith(OFS_ROOT):
+    key = join(path, key)
   else:
-    uri = normpath(join(cd, uri))
-  return uri
+    key = normpath(join(path, key))
+  return key
 
 
 def join(*comp_list):

+ 0 - 4
desktop/core/src/desktop/lib/fs/ozone/ofs.py

@@ -147,10 +147,6 @@ class OzoneFS(WebHdfs):
   def filebrowser_action(self):
     return self._filebrowser_action
 
-  def rename(self, old, new):
-    self.copy(old, new, recursive=True)
-    self.rmtree(old, skip_trash=True)
-
   def upload(self, file, path, *args, **kwargs):
     """
     Upload is done by the OFSFileUploadHandler