From: Varsha Rao Date: Fri, 29 Mar 2019 09:43:18 +0000 (+0530) Subject: cephfs-shell: Fix hidden files and directories list by ls command X-Git-Tag: v15.1.0~3029^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=67b670b74a0af34aace38e3a8ae99980f4012605;p=ceph.git cephfs-shell: Fix hidden files and directories list by ls command '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 --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index c535df539dac..88e45f1aacfd 100644 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -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: