提交 520c7780 编写于 作者: X xiexionghang

use absulote path whetn ls in hdfs

上级 af6da84f
...@@ -76,7 +76,6 @@ class LocalFSClient(object): ...@@ -76,7 +76,6 @@ class LocalFSClient(object):
"""R """R
""" """
files = os.listdir(path) files = os.listdir(path)
files = [path + '/' + fi for fi in files]
return files return files
...@@ -144,10 +143,13 @@ class FileHandler(object): ...@@ -144,10 +143,13 @@ class FileHandler(object):
def ls(self, path): def ls(self, path):
"""R """R
""" """
files = []
if is_afs_path(path): if is_afs_path(path):
return self._hdfs_client.ls(path) files = self._hdfs_client.ls(path)
else: else:
return self._local_fs_client.ls(path) files = self._local_fs_client.ls(path)
files = [path + '/' + fi for fi in files]
return files
def cp(self, org_path, dest_path): def cp(self, org_path, dest_path):
"""R """R
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册