]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: Fix ls -l 32801/head
authorKotresh HR <khiremat@redhat.com>
Thu, 23 Jan 2020 11:33:01 +0000 (17:03 +0530)
committerKotresh HR <khiremat@redhat.com>
Thu, 23 Jan 2020 12:14:04 +0000 (17:44 +0530)
"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 <khiremat@redhat.com>
src/tools/cephfs/cephfs-shell

index 01141027c260d979d4afc4f96b354b320ae0bdb3..4d1198d963bb23835b8c92b39266074b9bec7747 100755 (executable)
@@ -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