From: Rishabh Dave Date: Thu, 7 Jul 2022 12:56:09 +0000 (+0530) Subject: qa/cephfs: upgrade method authorize in class Filesystem X-Git-Tag: v18.0.0~466^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=be4e39e4c20f9a0849c2f07a293b739ac5831fec;p=ceph.git qa/cephfs: upgrade method authorize in class Filesystem 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 --- diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index 7354bc385022b..ca3ec48ed072f 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -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)