]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: Fix hidden files and directories list by ls command 27266/head
authorVarsha Rao <varao@redhat.com>
Fri, 29 Mar 2019 09:43:18 +0000 (15:13 +0530)
committerVarsha Rao <varao@redhat.com>
Sat, 30 Mar 2019 11:51:54 +0000 (17:21 +0530)
'ls -a' command should only list the hidden files and directories. This patch
fixes such listing by any other 'ls' commands.

Fixes: https://tracker.ceph.com/issues/38804
Signed-off-by: Varsha Rao <varao@redhat.com>
src/tools/cephfs/cephfs-shell

index c535df539dacf7894bc400050b92b545ae11bebc..88e45f1aacfda420d3bc54c3c0ce0b9cc1934d79 100644 (file)
@@ -567,7 +567,7 @@ exists.')
                     self.poutput(dir_name, ':\n')
                 items = sorted(list_items(dir_name),
                                key=lambda item: item.d_name)
-            if not args.all and len(items) > 2:
+            if not args.all and len(items) >= 2:
                 items = [i for i in items if not i.d_name.startswith('.')]
             flag = 0
             if args.S: