Skip to content

Commit

Permalink
cephfs-shell: fix chmod command
Browse files Browse the repository at this point in the history
Signed-off-by: Milind Changire <mchangir@redhat.com>
(cherry picked from commit 39f1151)
  • Loading branch information
mchangir authored and smithfarm committed Apr 18, 2019
1 parent c6e0f57 commit 802af8a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tools/cephfs/cephfs-shell
Expand Up @@ -845,15 +845,19 @@ sub-directories, files')
return self.complete_filenames(text, line, begidx, endidx)

chmod_parser = argparse.ArgumentParser(description='Create Directory.')
chmod_parser.add_argument('mode', type=int, help='Mode')
chmod_parser.add_argument('mode', type=str, action=ModeAction, help='Mode')
chmod_parser.add_argument('file_name', type=str, help='Name of the file')

@with_argparser(chmod_parser)
def do_chmod(self, args):
"""
Change permission of a file
"""
cephfs.chmod(args.file_name, args.mode)
mode = int(args.mode, base=8)
try:
cephfs.chmod(args.file_name, mode)
except:
self.poutput('%s: no such file or directory' % args.file_name)

def complete_cat(self, text, line, begidx, endidx):
"""
Expand Down

0 comments on commit 802af8a

Please sign in to comment.