From 02980e64fe66d1d1513389d67d49d72f9124377a Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Thu, 23 Jan 2020 17:03:01 +0530 Subject: [PATCH] cephfs-shell: Fix ls -l "ls -l" fails with ENOENT when it's executed outside root directory. This patch fixes the same. Fixes: https://tracker.ceph.com/issues/43763 Signed-off-by: Kotresh HR --- src/tools/cephfs/cephfs-shell | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 01141027c260..4d1198d963bb 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -808,16 +808,10 @@ class CephFSShell(Cmd): is_dir = item.is_dir() if args.long and args.H: - print_long(cephfs.getcwd() - + path - + b'/' - + filepath, + print_long(os.path.join(cephfs.getcwd(), path, filepath), is_dir, True) elif args.long: - print_long(cephfs.getcwd() - + path - + b'/' - + filepath, + print_long(os.path.join(cephfs.getcwd(), path, filepath), is_dir, False) elif is_dir: values.append(colorama.Style.BRIGHT -- 2.47.3