]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: Fix hidden files and directories list by ls command
authorVarsha Rao <varao@redhat.com>
Fri, 29 Mar 2019 09:43:18 +0000 (15:13 +0530)
committerNathan Cutler <ncutler@suse.com>
Thu, 11 Apr 2019 17:46:15 +0000 (19:46 +0200)
'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>
(cherry picked from commit 67b670b74a0af34aace38e3a8ae99980f4012605)

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: