]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: Add removexattr to support setfattr removal.
authorChristopher Hoffman <choffman@redhat.com>
Thu, 22 Feb 2024 16:54:44 +0000 (16:54 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Fri, 28 Jun 2024 17:28:24 +0000 (17:28 +0000)
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
(cherry picked from commit 26a352aae9a506d8594460e753fd4b21d9197076)

qa/tasks/cephfs/mount.py

index f995f7c8b4a41ceb32592097063b58aaaa135b4f..cbb0ec926532a75693fe06b0ce298010fe0f855c 100644 (file)
@@ -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.