From be4e39e4c20f9a0849c2f07a293b739ac5831fec Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Thu, 7 Jul 2022 18:26:09 +0530 Subject: [PATCH] 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 --- qa/tasks/cephfs/filesystem.py | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- 2.39.5