]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/smb: Add is_feature_enabled function to resource class
authorRabinarayan Panigrahi <rapanigr@redhat.com>
Fri, 8 May 2026 05:33:06 +0000 (11:03 +0530)
committerRabinarayan Panigrahi <rapanigr@redhat.com>
Thu, 18 Jun 2026 13:50:17 +0000 (19:20 +0530)
This funality added to find if feature like remote_control
and keybride is enable.

Signed-off-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
src/pybind/mgr/smb/resources.py

index 0128b6346d2bb142a78752baf8f6a77941f220a7..2956703e68e0218135344c8a9a2757a7f30713b8 100644 (file)
@@ -19,6 +19,7 @@ from ceph.smb.constants import (
     BURST_MULT_MIN,
     BYTES_LIMIT_MAX,
     IOPS_LIMIT_MAX,
+    KEYBRIDGE,
     REMOTE_CONTROL,
     REMOTE_CONTROL_LOCAL,
 )
@@ -989,6 +990,15 @@ class Cluster(_RBase):
             return False
         return self.keybridge.is_enabled
 
+    def is_feature_enabled(self, feature: str) -> bool:
+        """Return true if the specified SMB feature is enabled for this
+        cluster.
+        """
+        return {
+            REMOTE_CONTROL: self.remote_control_is_enabled,
+            KEYBRIDGE: self.keybridge_is_enabled,
+        }[feature]
+
     def is_clustered(self) -> bool:
         """Return true if smbd instance should use (CTDB) clustering."""
         if self.clustering_mode == SMBClustering.ALWAYS: