From 5dcb9e1d73d1ca7bd04e24ca0483dc6f028fca56 Mon Sep 17 00:00:00 2001 From: Christopher Hoffman Date: Thu, 22 Feb 2024 16:54:44 +0000 Subject: [PATCH] qa: Add removexattr to support setfattr removal. Signed-off-by: Christopher Hoffman (cherry picked from commit 26a352aae9a506d8594460e753fd4b21d9197076) --- qa/tasks/cephfs/mount.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py index f995f7c8b4a..cbb0ec92653 100644 --- a/qa/tasks/cephfs/mount.py +++ b/qa/tasks/cephfs/mount.py @@ -1483,6 +1483,20 @@ class CephFSMount(object): # gives you [''] instead of [] return [] + def removexattr(self, path, key, **kwargs): + """ + Wrap setfattr removal. + + :param path: relative to mount point + :param key: xattr name + :return: None + """ + kwargs['args'] = ["setfattr", "-x", key, path] + if kwargs.pop('sudo', False): + kwargs['args'].insert(0, 'sudo') + kwargs['omit_sudo'] = False + self.run_shell(**kwargs) + def setfattr(self, path, key, val, **kwargs): """ Wrap setfattr. -- 2.47.3