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>
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)