]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: upgrade method authorize in class Filesystem 47013/head
authorRishabh Dave <ridave@redhat.com>
Thu, 7 Jul 2022 12:56:09 +0000 (18:26 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 7 Jul 2022 15:48:48 +0000 (21:18 +0530)
Method authorize currently accepts caps as a list that should be as
follows -

(path1, perm2, path2, perm2)

Modify this method to also accepts caps arranged in following format -

((path1, perm1), (path2, perm2), (path3, perm3))

The latter format is pairs the path and the permission to be set on path
together. This makes the association more apparent and thus it less
prone to human error.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/cephfs/filesystem.py

index 7354bc385022b8dc3a766f7d63290899512443b1..ca3ec48ed072f6031bcbc8dbb8a75f0132d620d8 100644 (file)
@@ -1551,6 +1551,12 @@ class Filesystem(MDSCluster):
         caps: tuple containing the path and permission (can be r or rw)
               respectively.
         """
+        if isinstance(caps[0], (tuple, list)):
+            x = []
+            for c in caps:
+                x.extend(c)
+            caps = tuple(x)
+
         client_name = 'client.' + client_id
         return self.mon_manager.raw_cluster_cmd('fs', 'authorize', self.name,
                                                 client_name, *caps)