From b92ff840cc5971c62f91dbe3e4ade4210bf3258d Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Sat, 13 Apr 2019 12:15:47 +0530 Subject: [PATCH] cephfs-shell: fix cat command Signed-off-by: Milind Changire --- src/tools/cephfs/cephfs-shell | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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( -- 2.47.3