From: neeraj pratap singh Date: Wed, 5 Mar 2025 14:06:01 +0000 (+0530) Subject: cephfs-shell: Add the option to remove xattr X-Git-Tag: testing/wip-jcollin-testing-20250918.013120-squid~2^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=66957e1fd1d1602445583c614cb30cba2a1abcf2;p=ceph-ci.git cephfs-shell: Add the option to remove xattr Fixes: https://tracker.ceph.com/issues/69274 Signed-off-by: Neeraj Pratap Singh (cherry picked from commit ef84118419a91d48445116704af97dec2d778369) --- diff --git a/src/tools/cephfs/shell/cephfs-shell b/src/tools/cephfs/shell/cephfs-shell index f95a4afd057..3564d76f913 100755 --- a/src/tools/cephfs/shell/cephfs-shell +++ b/src/tools/cephfs/shell/cephfs-shell @@ -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) + ####################################################### #