From: Rishabh Dave Date: Fri, 13 Dec 2019 14:23:24 +0000 (+0530) Subject: cephfs-shell: don't catch libcephfs.Error unnecessarily X-Git-Tag: v15.1.0~258^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F32213%2Fhead;p=ceph.git cephfs-shell: don't catch libcephfs.Error unnecessarily Signed-off-by: Rishabh Dave --- 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): """