]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/volumes/nfs: Remove type option from export create interface
authorVarsha Rao <varao@redhat.com>
Fri, 15 May 2020 17:56:13 +0000 (23:26 +0530)
committerVarsha Rao <varao@redhat.com>
Wed, 8 Jul 2020 05:36:35 +0000 (07:36 +0200)
Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit 9bcd7b673d7206a35abc9bf612ec3ff05f491ba7)

doc/cephfs/fs-nfs-exports.rst
src/pybind/mgr/volumes/fs/nfs.py
src/pybind/mgr/volumes/module.py

index 2c8f5e203f08f31eabd542a277b1a6251ce72766..5776d77f16622211e6ff56482e7ce35ee10f65f1 100644 (file)
@@ -50,11 +50,10 @@ Create CephFS Export
 
 .. code:: bash
 
-    $ ceph nfs export create <type=cephfs> <fsname> <clusterid> <binding> [--readonly] [--path=/path/in/cephfs]
+    $ ceph nfs export create cephfs <fsname> <clusterid> <binding> [--readonly] [--path=/path/in/cephfs]
 
 It creates export rados objects containing the export block. Here binding is
-the pseudo root name and type is export type. Currently only CephFS is
-supported.
+the pseudo root name and type is export type.
 
 Delete CephFS Export
 ====================
index b3f68ed60ca1d24cff724c250dd84bcf92f4a337..0df2751895a885595e9b8b1acff95b01e92b11e9 100644 (file)
@@ -294,10 +294,7 @@ class FSExport(object):
         self._write_raw_config(conf_block, "export-{}".format(export.export_id))
         self._update_common_conf(export.cluster_id, export.export_id)
 
-    def create_export(self, export_type, fs_name, cluster_id, pseudo_path, read_only, path):
-        if export_type != 'cephfs':
-            return -errno.EINVAL,"", f"Invalid export type: {export_type}"
-
+    def create_export(self, fs_name, cluster_id, pseudo_path, read_only, path):
         if not self.check_fs(fs_name):
             return -errno.EINVAL,"", "Invalid CephFS name"
 
index 08918755e97edca6a5076a114632709aada93b88..fd860e4f7987bc4e24f048d7fefe905cc69e9699 100644 (file)
@@ -254,8 +254,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
             'perm': 'r'
         },
         {
-            'cmd': 'nfs export create '
-            'name=type,type=CephString '
+            'cmd': 'nfs export create cephfs '
             'name=fsname,type=CephString '
             'name=attach,type=CephString '
             'name=binding,type=CephString '
@@ -481,14 +480,13 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
         return self.vc.clone_cancel(
             vol_name=cmd['vol_name'], clone_name=cmd['clone_name'],  group_name=cmd.get('group_name', None))
 
-    def _cmd_nfs_export_create(self, inbuf, cmd):
+    def _cmd_nfs_export_create_cephfs(self, inbuf, cmd):
         #TODO Extend export creation for rgw.
-        return self.fs_export.create_export(export_type=cmd['type'], fs_name=cmd['fsname'],
-                cluster_id=cmd.get('attach'), pseudo_path=cmd.get('binding'),
-                read_only=cmd.get('readonly', False), path=cmd.get('path', '/'))
+        return self.fs_export.create_export(fs_name=cmd['fsname'], cluster_id=cmd['attach'],
+                pseudo_path=cmd['binding'], read_only=cmd.get('readonly', False), path=cmd.get('path', '/'))
 
     def _cmd_nfs_export_delete(self, inbuf, cmd):
-        return self.fs_export.delete_export(cluster_id=cmd.get('attach'), pseudo_path=cmd.get('binding'))
+        return self.fs_export.delete_export(cluster_id=cmd['attach'], pseudo_path=cmd['binding'])
 
     def _cmd_nfs_cluster_create(self, inbuf, cmd):
         return self.nfs.create_nfs_cluster(cluster_id=cmd['clusterid'], export_type=cmd['type'],