From 477f49216e1ab884b217fa24436944365fbbc02f Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Fri, 13 Dec 2019 19:53:24 +0530 Subject: [PATCH] cephfs-shell: don't catch libcephfs.Error unnecessarily Signed-off-by: Rishabh Dave --- src/tools/cephfs/cephfs-shell | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index bace4bb4a5eef..01141027c260d 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -938,11 +938,7 @@ class CephFSShell(Cmd): """ Rename a file or Move a file from source path to the destination """ - try: - cephfs.rename(args.src_path, args.dest_path) - except libcephfs.Error as e: - perror(e) - self.exit_code = e.get_error_code() + cephfs.rename(args.src_path, args.dest_path) def complete_cd(self, text, line, begidx, endidx): """ @@ -959,13 +955,9 @@ class CephFSShell(Cmd): """ Change working directory """ - try: - cephfs.chdir(args.path) - self.working_dir = cephfs.getcwd().decode('utf-8') - self.set_prompt() - except libcephfs.Error as e: - perror(e) - self.exit_code = e.get_error_code() + cephfs.chdir(args.path) + self.working_dir = cephfs.getcwd().decode('utf-8') + self.set_prompt() def do_cwd(self, arglist): """ -- 2.47.3