From: shenhang Date: Wed, 11 Sep 2019 14:06:01 +0000 (+0800) Subject: cephfs-shell: better complain info, when deleting non-empty directory X-Git-Tag: v15.1.0~1358^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F30341%2Fhead;p=ceph.git cephfs-shell: better complain info, when deleting non-empty directory fixes:http://tracker.ceph.com/issues/40864 Signed-off-by: Shen Hang --- 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): """