]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: Clarify no container engine message 42395/head
authorSebastian Wagner <sewagner@redhat.com>
Mon, 19 Jul 2021 08:23:52 +0000 (10:23 +0200)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 3 Aug 2021 14:32:13 +0000 (16:32 +0200)
Multiple people didn't understand the message. Let's try to impove it.

(Also make mypy happy)

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
src/cephadm/cephadm

index 385d7500e3349a3371faf628146b5ee80d91552c..fb63399e65663abcdbd6f4f0bc9e65d85ad14155 100755 (executable)
@@ -167,8 +167,9 @@ class ContainerEngine:
     def __init__(self):
         self.path = find_program(self.EXE)
 
+    @classmethod
     @property
-    def EXE(self) -> str:
+    def EXE(cls) -> str:
         raise NotImplementedError()
 
 
@@ -1981,7 +1982,9 @@ def check_container_engine(ctx):
     # type: (CephadmContext) -> None
     engine = ctx.container_engine
     if not isinstance(engine, CONTAINER_PREFERENCE):
-        raise Error('Unable to locate any of %s' % [i.EXE for i in CONTAINER_PREFERENCE])
+        # See https://github.com/python/mypy/issues/8993
+        exes: List[str] = [i.EXE for i in CONTAINER_PREFERENCE]  # type: ignore
+        raise Error('No container engine binary found ({}). Try run `apt/dnf/yum/zypper install <container engine>`'.format(' or '.join(exes)))
     elif isinstance(engine, Podman):
         engine.get_version(ctx)
         if engine.version < MIN_PODMAN_VERSION: