]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes: Add tenant_id option to subvolume authorize
authorKotresh HR <khiremat@redhat.com>
Mon, 23 Nov 2020 06:08:27 +0000 (11:38 +0530)
committerKotresh HR <khiremat@redhat.com>
Fri, 5 Mar 2021 06:50:31 +0000 (12:20 +0530)
Fixes: https://tracker.ceph.com/issues/44931
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit 39acfcc91c1b6a85f6fa96a5e894d81a7225f9dc)

src/pybind/mgr/volumes/fs/volume.py
src/pybind/mgr/volumes/module.py

index ad1d562e83bfb54d38ea0e2789a4537d2124365e..0924a9b61fe544d61d259bb10ddc99ab2c1eae59 100644 (file)
@@ -213,12 +213,13 @@ class VolumeClient(object):
         authid      = kwargs['auth_id']
         groupname   = kwargs['group_name']
         accesslevel = kwargs['access_level']
+        tenant_id   = kwargs['tenant_id']
 
         try:
             with open_volume(self, volname) as fs_handle:
                 with open_group(fs_handle, self.volspec, groupname) as group:
                     with open_subvol(self.mgr, fs_handle, self.volspec, group, subvolname, SubvolumeOpType.ALLOW_ACCESS) as subvolume:
-                        key = subvolume.authorize(authid, accesslevel)
+                        key = subvolume.authorize(authid, accesslevel, tenant_id)
                         ret = 0, key, ""
         except VolumeException as ve:
             ret = self.volume_exception_to_retval(ve)
index b8b64859b7bbefa90138a8a9e7d7013ab67c8dbb..0ae663ced605f8124004b1742291934cd3b24f39 100644 (file)
@@ -123,7 +123,8 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
                    'name=sub_name,type=CephString '
                    'name=auth_id,type=CephString '
                    'name=group_name,type=CephString,req=false '
-                   'name=access_level,type=CephString,req=false ',
+                   'name=access_level,type=CephString,req=false '
+                   'name=tenant_id,type=CephString,req=false ',
             'desc': "Allow a cephx auth ID access to a subvolume",
             'perm': 'rw'
         },
@@ -520,7 +521,8 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
                                            sub_name=cmd['sub_name'],
                                            auth_id=cmd['auth_id'],
                                            group_name=cmd.get('group_name', None),
-                                           access_level=cmd.get('access_level', 'rw'))
+                                           access_level=cmd.get('access_level', 'rw'),
+                                           tenant_id=cmd.get('tenant_id', None))
 
     @mgr_cmd_wrap
     def _cmd_fs_subvolume_deauthorize(self, inbuf, cmd):