From e917afe3908278edce3ff1a6315c6477bc348074 Mon Sep 17 00:00:00 2001 From: shenhang Date: Wed, 11 Sep 2019 22:06:01 +0800 Subject: [PATCH] cephfs-shell: better complain info, when deleting non-empty directory fixes:http://tracker.ceph.com/issues/40864 Signed-off-by: Shen Hang --- src/tools/cephfs/cephfs-shell | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 1fa54bc07769..7ce48fe43b3f 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -842,10 +842,9 @@ sub-directories, files') if not is_pattern and path != os.path.normpath(b''): try: cephfs.rmdir(path) - except libcephfs.Error: - self.perror('error: no such directory {} exists'.format( - path.decode('utf-8')), end='\n', - apply_style=True) + except libcephfs.Error as e: + self.perror('Error in rmdir {}: {}'.format( + path.decode('utf-8'), os.strerror(e.errno))) def complete_rm(self, text, line, begidx, endidx): """ -- 2.47.3