From 520c7780f30d33cef07a18a96a58edd58fc2f79f Mon Sep 17 00:00:00 2001 From: xiexionghang Date: Wed, 18 Mar 2020 16:53:23 +0800 Subject: [PATCH] use absulote path whetn ls in hdfs --- kagle/kagle_fs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kagle/kagle_fs.py b/kagle/kagle_fs.py index 86bcc43e..d2e51017 100755 --- a/kagle/kagle_fs.py +++ b/kagle/kagle_fs.py @@ -76,7 +76,6 @@ class LocalFSClient(object): """R """ files = os.listdir(path) - files = [path + '/' + fi for fi in files] return files @@ -144,10 +143,13 @@ class FileHandler(object): def ls(self, path): """R """ + files = [] if is_afs_path(path): - return self._hdfs_client.ls(path) + files = self._hdfs_client.ls(path) 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): """R -- GitLab