Skip to content

Commit ef84118

Browse files
author
neeraj pratap singh
committed
cephfs-shell: Add the option to remove xattr
Fixes: https://tracker.ceph.com/issues/69274 Signed-off-by: Neeraj Pratap Singh <[email protected]>
1 parent d492e85 commit ef84118

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/tools/cephfs/shell/cephfs-shell

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,22 @@ class CephFSShell(Cmd):
16641664
except libcephfs.Error as e:
16651665
set_exit_code_msg(msg=e)
16661666

1667+
removexattr_parser = argparse.ArgumentParser(
1668+
description='Remove extended attribute set for a file')
1669+
removexattr_parser.add_argument('path', type=str, action=path_to_bytes,
1670+
help='Name of the file')
1671+
removexattr_parser.add_argument('name', type=str, help='Extended attribute name')
1672+
1673+
@with_argparser(removexattr_parser)
1674+
def do_removexattr(self, args):
1675+
"""
1676+
Remove extended attribute for a file
1677+
"""
1678+
try:
1679+
poutput('{}'.format(cephfs.removexattr(args.path, to_bytes(args.name))))
1680+
except libcephfs.Error as e:
1681+
set_exit_code_msg(msg=e)
1682+
16671683

16681684
#######################################################
16691685
#

0 commit comments

Comments
 (0)