Currently, if we try to delete subvolumegroup using `fs subvolumegroup rm`
when there's one or more subvolume(s) present under that subvolumegroup we
see the error something like :
`Error ENOTEMPTY: error in rmdir /volumes/group1`
which causes confusion. Make it more descriptive
Fixes: https://tracker.ceph.com/issues/62968
Signed-off-by: Neeraj Pratap Singh <neesingh@redhat.com>
except cephfs.Error as e:
if e.args[0] == errno.ENOENT:
raise VolumeException(-errno.ENOENT, "subvolume group '{0}' does not exist".format(groupname))
+ elif e.args[0] == errno.ENOTEMPTY:
+ raise VolumeException(-errno.ENOTEMPTY, f"subvolume group {groupname} contains subvolume(s) "
+ "or retained snapshots of deleted subvolume(s)")
raise VolumeException(-e.args[0], e.args[1])