From: Rabinarayan Panigrahi Date: Fri, 8 May 2026 05:33:06 +0000 (+0530) Subject: mgr/smb: Add is_feature_enabled function to resource class X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=362580714d20ced87485ee16efc07b6ba0038118;p=ceph.git mgr/smb: Add is_feature_enabled function to resource class This funality added to find if feature like remote_control and keybride is enable. Signed-off-by: Rabinarayan Panigrahi --- diff --git a/src/pybind/mgr/smb/resources.py b/src/pybind/mgr/smb/resources.py index 0128b6346d2..2956703e68e 100644 --- a/src/pybind/mgr/smb/resources.py +++ b/src/pybind/mgr/smb/resources.py @@ -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: