]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: Add doc about how to use OrchestratorClientMixin 32893/head
authorSebastian Wagner <sebastian.wagner@suse.com>
Mon, 27 Jan 2020 10:12:55 +0000 (11:12 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 28 Jan 2020 10:09:07 +0000 (11:09 +0100)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/orchestrator.py

index 35d7e278ebf70cf2b4efd0b2d832617c41e23b2e..0335b56a8c6d7cd9ef696bf8e0f6beb37690a881 100644 (file)
@@ -1467,6 +1467,16 @@ class OrchestratorClientMixin(Orchestrator):
     ...        self._orchestrator_wait([completion])
     ...        self.log.debug(completion.result)
 
+    .. note:: Orchestrator implementations should not inherit from `OrchestratorClientMixin`.
+        Reason is, that OrchestratorClientMixin magically redirects all methods to the
+        "real" implementation of the orchestrator.
+
+
+    >>> import mgr_module
+    >>> class MyImplentation(mgr_module.MgrModule, Orchestrator):
+    ...     def __init__(self, ...):
+    ...         self.orch_client = OrchestratorClientMixin()
+    ...         self.orch_client.set_mgr(self.mgr))
     """
 
     def set_mgr(self, mgr):