Browse Source

[webhdfs] rename operation should handle a relative destination path

bc Wong 13 years ago
parent
commit
78513e5f8c
1 changed files with 2 additions and 0 deletions
  1. 2 0
      desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

+ 2 - 0
desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

@@ -270,6 +270,8 @@ class WebHdfs(Hdfs):
   def rename(self, old, new):
     """rename(old, new)"""
     old = Hdfs.normpath(old)
+    if not new.startswith('/'):
+      new = Hdfs.join(Hdfs.dirname(old), new)
     new = Hdfs.normpath(new)
     params = self._getparams()
     params['op'] = 'RENAME'