From: Sebastian Wagner Date: Mon, 18 Jan 2021 15:02:38 +0000 (+0100) Subject: mgr/orchestrator: disallow_untyped_defs = True X-Git-Tag: v16.2.0~232^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a54938f93ff46c9aff6cc3760cea1b7e3ff9980a;p=ceph.git mgr/orchestrator: disallow_untyped_defs = True Signed-off-by: Sebastian Wagner (cherry picked from commit c95ba878c66aae44816b1451049449685d444f0a) --- diff --git a/src/mypy.ini b/src/mypy.ini index b5d61edf911d5..c5c7bb42e7106 100755 --- a/src/mypy.ini +++ b/src/mypy.ini @@ -24,6 +24,9 @@ disallow_untyped_defs = True [mypy-orchestrator.*] disallow_untyped_defs = True +[mypy-orchestrator.*] +disallow_untyped_defs = True + # Make cephadm and rook happy [mypy-OpenSSL] ignore_missing_imports = True diff --git a/src/pybind/mgr/cephadm/services/cephadmservice.py b/src/pybind/mgr/cephadm/services/cephadmservice.py index b6e1930c5b446..bbc4b75900029 100644 --- a/src/pybind/mgr/cephadm/services/cephadmservice.py +++ b/src/pybind/mgr/cephadm/services/cephadmservice.py @@ -235,6 +235,7 @@ class CephadmService(metaclass=ABCMeta): """ Called before the daemon is removed. """ + assert daemon.daemon_type is not None assert self.TYPE == daemon_type_to_service(daemon.daemon_type) logger.debug(f'Pre remove daemon {self.TYPE}.{daemon.daemon_id}') @@ -242,6 +243,7 @@ class CephadmService(metaclass=ABCMeta): """ Called after the daemon is removed. """ + assert daemon.daemon_type is not None assert self.TYPE == daemon_type_to_service(daemon.daemon_type) logger.debug(f'Post remove daemon {self.TYPE}.{daemon.daemon_id}') diff --git a/src/pybind/mgr/orchestrator/_interface.py b/src/pybind/mgr/orchestrator/_interface.py index cc726d52d7da2..df5ece65ca659 100644 --- a/src/pybind/mgr/orchestrator/_interface.py +++ b/src/pybind/mgr/orchestrator/_interface.py @@ -117,6 +117,8 @@ def handle_exception(prefix: str, perm: str, func: FuncT) -> FuncT: class InnerCliCommandCallable(Protocol): def __call__(self, prefix: str) -> Callable[[FuncT], FuncT]: ... +class InnerCliCommandCallable(Protocol): + def __call__(self, prefix: str) -> Callable[[FuncT], FuncT]: ... def _cli_command(perm: str) -> InnerCliCommandCallable: def inner_cli_command(prefix: str) -> Callable[[FuncT], FuncT]: @@ -668,7 +670,6 @@ def _hide_in_features(f: FuncT) -> FuncT: f._hide_in_features = True # type: ignore return f - class Orchestrator(object): """ Calls in this class may do long running remote operations, with time