]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: warn when deprecated export/cluster delete commands are run
authorDhairya Parmar <dparmar@redhat.com>
Fri, 29 May 2026 13:30:20 +0000 (19:00 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Fri, 29 May 2026 13:30:20 +0000 (19:00 +0530)
change the hander from EmptyResponder() to ErrorResponseHandler() to
emit the warning making use of the command's status channel.

Fixes: https://tracker.ceph.com/issues/61482
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
src/pybind/mgr/nfs/module.py

index 1f5cb304aa67c5133be9549bbac67afa1a24cf4a..9da22befbfe81602f084d05c43f270835e326ce3 100644 (file)
@@ -112,14 +112,16 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
         return self.export_mgr.delete_export(cluster_id=cluster_id, pseudo_path=pseudo_path)
 
     @NFSCLICommand('nfs export delete', perm='rw')
-    @object_format.EmptyResponder()
+    @object_format.ErrorResponseHandler()
     def _cmd_nfs_export_delete(self,
                                cluster_id: str,
                                pseudo_path: str,
-                               skip_notify_nfs_server: bool = False) -> None:
+                               skip_notify_nfs_server: bool = False) -> Tuple[int, str, str]:
         """Delete a cephfs export (DEPRECATED)"""
         self.export_mgr.skip_notify_nfs_server = skip_notify_nfs_server
-        return self.export_mgr.delete_export(cluster_id=cluster_id, pseudo_path=pseudo_path)
+        self.export_mgr.delete_export(cluster_id=cluster_id, pseudo_path=pseudo_path)
+        return 0, "", ("`nfs export delete` is deprecated and will be removed "
+                       "in a future release, please `nfs export rm` instead.")
 
     @NFSCLICommand('nfs export ls', perm='r')
     @object_format.Responder()
@@ -203,10 +205,12 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
         return self.nfs.delete_nfs_cluster(cluster_id=cluster_id)
 
     @NFSCLICommand('nfs cluster delete', perm='rw')
-    @object_format.EmptyResponder()
-    def _cmd_nfs_cluster_delete(self, cluster_id: str) -> None:
+    @object_format.ErrorResponseHandler()
+    def _cmd_nfs_cluster_delete(self, cluster_id: str) -> Tuple[int, str, str]:
         """Removes an NFS Cluster (DEPRECATED)"""
-        return self.nfs.delete_nfs_cluster(cluster_id=cluster_id)
+        self.nfs.delete_nfs_cluster(cluster_id=cluster_id)
+        return 0, "", ("`nfs cluster delete` is deprecated and will be removed "
+                       "in a future release, please `nfs cluster rm` instead.")
 
     @NFSCLICommand('nfs cluster ls', perm='r')
     @object_format.Responder()