]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephfs-shell: Add the option to remove xattr
authorneeraj pratap singh <neerajpratapsingh@li-ff7f0d4c-3462-11b2-a85c-d4004c0fa1a0.ibm.com>
Wed, 5 Mar 2025 14:06:01 +0000 (19:36 +0530)
committerneeraj pratap singh <neerajpratapsingh@li-ff7f0d4c-3462-11b2-a85c-d4004c0fa1a0.ibm.com>
Wed, 19 Mar 2025 11:13:18 +0000 (16:43 +0530)
Fixes: https://tracker.ceph.com/issues/69274
Signed-off-by: Neeraj Pratap Singh <neesingh@redhat.com>
(cherry picked from commit ef84118419a91d48445116704af97dec2d778369)

src/tools/cephfs/shell/cephfs-shell

index f95a4afd0579ccf2e84273fa6013014bad8002ec..3564d76f91354984139d39215b1bea7be3bbacf0 100755 (executable)
@@ -1664,6 +1664,22 @@ class CephFSShell(Cmd):
         except libcephfs.Error as e:
             set_exit_code_msg(msg=e)
 
+    removexattr_parser = argparse.ArgumentParser(
+        description='Remove extended attribute set for a file')
+    removexattr_parser.add_argument('path', type=str, action=path_to_bytes,
+                                    help='Name of the file')
+    removexattr_parser.add_argument('name', type=str, help='Extended attribute name')
+
+    @with_argparser(removexattr_parser)
+    def do_removexattr(self, args):
+        """
+        Remove extended attribute for a file
+        """
+        try:
+            poutput('{}'.format(cephfs.removexattr(args.path, to_bytes(args.name))))
+        except libcephfs.Error as e:
+            set_exit_code_msg(msg=e)
+
 
 #######################################################
 #