]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/orchestrator: disallow_untyped_defs = True
authorSebastian Wagner <sebastian.wagner@suse.com>
Mon, 18 Jan 2021 15:02:38 +0000 (16:02 +0100)
committerJuan Miguel Olmo Martínez <jolmomar@redhat.com>
Tue, 26 Jan 2021 10:10:39 +0000 (11:10 +0100)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit c95ba878c66aae44816b1451049449685d444f0a)

src/mypy.ini
src/pybind/mgr/cephadm/services/cephadmservice.py
src/pybind/mgr/orchestrator/_interface.py

index b5d61edf911d546df73edd46ab68ca29ca9c180c..c5c7bb42e710647d9a800654b5216007b8b786dd 100755 (executable)
@@ -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
index b6e1930c5b4468945733fd611929a1183acccd80..bbc4b759000290b38c820035dbeb7bcad502d2ee 100644 (file)
@@ -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}')
 
index cc726d52d7da22449faf792011593991b10ab123..df5ece65ca6599fd2934e460f82ed865087d9c87 100644 (file)
@@ -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