From: Milind Changire Date: Sat, 13 Apr 2019 06:45:47 +0000 (+0530) Subject: cephfs-shell: fix cat command X-Git-Tag: v15.1.0~2908^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b92ff840cc5971c62f91dbe3e4ade4210bf3258d;p=ceph.git cephfs-shell: fix cat command Signed-off-by: Milind Changire --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 29aee0d5f92..0d00bd58984 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -874,8 +874,10 @@ sub-directories, files') Print contents of a file """ for file_name in args.file_names: - self.poutput(file_name) - copy_to_local(file_name, '-') + if is_file_exists(file_name): + copy_to_local(file_name, '-') + else: + self.poutput('%s: no such file' % file_name) umask_parser = argparse.ArgumentParser(description='Set umask value.') umask_parser.add_argument(