]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add serve.py
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 11 Sep 2020 10:39:01 +0000 (12:39 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Wed, 18 Nov 2020 10:52:17 +0000 (11:52 +0100)
This module contains functions that are executed in the
serve() thread.
Meaning they don't block the CLI

Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit acd6854bbc8985f8b2f6f2bfaa84f7e4c31d6660)

src/pybind/mgr/cephadm/serve.py [new file with mode: 0644]

diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py
new file mode 100644 (file)
index 0000000..74d5353
--- /dev/null
@@ -0,0 +1,20 @@
+import logging
+from typing import TYPE_CHECKING
+
+if TYPE_CHECKING:
+    from cephadm.module import CephadmOrchestrator
+
+logger = logging.getLogger(__name__)
+
+
+class CephadmServe:
+    """
+    This module contains functions that are executed in the
+    serve() thread. Thus they don't block the CLI.
+
+    On the other hand, These function should *not* be called form
+    CLI handlers, to avoid blocking the CLI
+    """
+
+    def __init__(self, mgr: "CephadmOrchestrator"):
+        self.mgr: "CephadmOrchestrator" = mgr