]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: add a --fs argument to allow mounting named filesystems 44279/head
authorJeff Layton <jlayton@redhat.com>
Fri, 10 Dec 2021 14:32:13 +0000 (09:32 -0500)
committerJeff Layton <jlayton@redhat.com>
Thu, 16 Dec 2021 11:11:11 +0000 (06:11 -0500)
Add a new --fs argument to cephfs-shell, so we can use it to mount named
filesystems. Add a blurb to the manpage for it, and alphebetize the
command-line flags.

Fixes: https://tracker.ceph.com/issues/50235
Signed-off-by: Jeff Layton <jlayton@redhat.com>
doc/man/8/cephfs-shell.rst
src/tools/cephfs/cephfs-shell

index b8a3699f90c55401b5a0cb4c6656336e80ba2893..65b344fa9126ccc06b6cbd403f807012f452f9b9 100644 (file)
@@ -32,13 +32,17 @@ Behaviour of CephFS Shell can be tweaked using ``cephfs-shell.conf``. Refer to
 Options
 =======
 
+.. option:: -b, --batch FILE
+
+   Path to batch file.
+
 .. option:: -c, --config FILE
 
    Path to cephfs-shell.conf
 
-.. option:: -b, --batch FILE
+.. option:: -f, --fs FS
 
-   Path to batch file.
+   Name of filesystem to mount.
 
 .. option:: -t, --test FILE
 
index d1916a9061847355be020c7479ebb1bc0b65dc64..923eefb6788a7c505b9275f93cf4a472845b5505 100755 (executable)
@@ -1498,14 +1498,14 @@ class CephFSShell(Cmd):
 #
 #####################################################
 
-def setup_cephfs():
+def setup_cephfs(args):
     """
     Mounting a cephfs
     """
     global cephfs
     try:
         cephfs = libcephfs.LibCephFS(conffile='')
-        cephfs.mount()
+        cephfs.mount(filesystem_name=args.fs)
     except libcephfs.ObjectNotFound as e:
         print('couldn\'t find ceph configuration not found')
         sys.exit(e.get_error_code())
@@ -1580,13 +1580,16 @@ def get_shell_conffile_path(arg_conf=''):
 
 def manage_args():
     main_parser = argparse.ArgumentParser(description='')
-    main_parser.add_argument('-c', '--config', action='store',
-                             help='Path to Ceph configuration file.',
-                             type=str)
     main_parser.add_argument('-b', '--batch', action='store',
                              help='Path to CephFS shell script/batch file'
                                   'containing CephFS shell commands',
                              type=str)
+    main_parser.add_argument('-c', '--config', action='store',
+                             help='Path to Ceph configuration file.',
+                             type=str)
+    main_parser.add_argument('-f', '--fs', action='store',
+                             help='Name of filesystem to mount.',
+                             type=str)
     main_parser.add_argument('-t', '--test', action='store',
                              help='Test against transcript(s) in FILE',
                              nargs='+')
@@ -1620,7 +1623,7 @@ def manage_sys_argv(args):
     sys.argv.append(exe)
     sys.argv.extend([i.strip() for i in ' '.join(args.commands).split(',')])
 
-    setup_cephfs()
+    setup_cephfs(args)
 
 
 def execute_cmd_args(args):