From e47224566b0de332ae490757199a26e2a2bd3aed Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 11 Sep 2020 12:39:01 +0200 Subject: [PATCH] mgr/cephadm: add serve.py This module contains functions that are executed in the serve() thread. Meaning they don't block the CLI Signed-off-by: Sebastian Wagner (cherry picked from commit acd6854bbc8985f8b2f6f2bfaa84f7e4c31d6660) --- src/pybind/mgr/cephadm/serve.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/pybind/mgr/cephadm/serve.py diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py new file mode 100644 index 0000000000000..74d5353eadd55 --- /dev/null +++ b/src/pybind/mgr/cephadm/serve.py @@ -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 -- 2.39.5