Right now, we're violating the Liskov substitution principle by deriving from `Orchestrator` but `process` takes a sub class of `Completion`:
See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
The idea is to make Orchestrator a type constructor with `CompletionT` as argument, but this is not supported by mypy: https://github.com/python/typing/issues/548
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit
9923d2a1193c374b9c2e00b5ee69023cb72a9f00)
return False, 'SSH keys not set. Use `ceph cephadm set-priv-key` and `ceph cephadm set-pub-key` or `ceph cephadm generate-key`'
return True, ''
- def process(self, completions: List[CephadmCompletion]) -> None:
+ def process(self, completions: List[CephadmCompletion]) -> None: # type: ignore
"""
Does nothing, as completions are processed in another thread.
"""
# TODO: configure k8s API addr instead of assuming local
]
- def process(self, completions):
- # type: (List[RookCompletion]) -> None
-
+ def process(self, completions: List[RookCompletion]) -> None: # type: ignore
if completions:
self.log.info("process: completions={0}".format(orchestrator.pretty_print(completions)))
The implementation is similar to the Rook orchestrator, but simpler.
"""
- def process(self, completions):
- # type: (List[TestCompletion]) -> None
+ def process(self, completions: List[TestCompletion]) -> None: # type: ignore
if completions:
self.log.info("process: completions={0}".format(orchestrator.pretty_print(completions)))