]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/smb: add an option to enable the local variation of remotectl
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 23 Feb 2026 17:23:57 +0000 (12:23 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 4 Mar 2026 17:45:59 +0000 (12:45 -0500)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/smb/resources.py

index 29ca657b4b6c40e841edc8f99f2f07039c617301..e72a5f82cc6521e702a3467f8feba9b78076f157 100644 (file)
@@ -14,6 +14,7 @@ from ceph.deployment.service_spec import (
     SMBClusterPublicIPSpec,
     SpecValidationError,
 )
+from ceph.smb.constants import REMOTE_CONTROL, REMOTE_CONTROL_LOCAL
 from ceph.smb.network import to_network
 from object_format import ErrorResponseBase
 
@@ -604,6 +605,9 @@ class ExternalCephClusterSource(_RBase):
 class RemoteControl(_RBase):
     # enabled can be set to explicitly toggle the remote control server
     enabled: Optional[bool] = None
+    # locally_enabled can be set to explicitly toggle the remote control
+    # servers local unix socket mode
+    locally_enabled: Optional[bool] = None
     # cert specifies the ssl/tls certificate to use
     cert: Optional[TLSSource] = None
     # cert specifies the ssl/tls server key to use
@@ -617,10 +621,24 @@ class RemoteControl(_RBase):
 
     @property
     def is_enabled(self) -> bool:
+        return self._locally_enabled() or self._remotely_enabled()
+
+    def _locally_enabled(self) -> bool:
+        return bool(self.locally_enabled)
+
+    def _remotely_enabled(self) -> bool:
         if self.enabled is not None:
             return self.enabled
         return bool(self.cert and self.key)
 
+    def enabled_features(self) -> list[str]:
+        out = []
+        if self._locally_enabled():
+            out.append(REMOTE_CONTROL_LOCAL)
+        if self._remotely_enabled():
+            out.append(REMOTE_CONTROL)
+        return out
+
 
 @resourcelib.resource('ceph.smb.cluster')
 class Cluster(_RBase):