]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/volumes: subvolume ls command crashes if groupname as '_nogroup'
authorNikhilkumar Shelke <nshelke@redhat.com>
Sun, 12 Jun 2022 16:28:40 +0000 (21:58 +0530)
committerNikhilkumar Shelke <nshelke@redhat.com>
Tue, 14 Jun 2022 06:47:23 +0000 (12:17 +0530)
If --group_name=_nogroup is provided in the command then
throw error permission denied as it is internal group of ceph fs.

Fixes: https://tracker.ceph.com/issues/55759
Signed-off-by: Nikhilkumar Shelke <nshelke@redhat.com>
src/pybind/mgr/volumes/fs/operations/group.py

index 152383c51d43a3e1ae3ccf4b080d7b4b285deebf..777721d5e412db91603d7f4aa98a8457a32b9e13 100644 (file)
@@ -20,7 +20,8 @@ class Group(GroupTemplate):
     NO_GROUP_NAME = "_nogroup"
 
     def __init__(self, fs, vol_spec, groupname):
-        assert groupname != Group.NO_GROUP_NAME
+        if groupname == Group.NO_GROUP_NAME:
+            raise VolumeException(-errno.EPERM, "Operation not permitted for group '{0}' as it is an internal group.".format(groupname))
         self.fs = fs
         self.user_id = None
         self.group_id = None