From: Paul Cuzner Date: Fri, 18 Dec 2020 01:45:07 +0000 (+1300) Subject: mgr/cephadm: correct connection failure message X-Git-Tag: v15.2.9~88^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e31ab567e4d839efd88248cc1fffb67e1dd563f6;p=ceph.git mgr/cephadm: correct connection failure message When add host fails with py3 missing, wasn't used in the output returned to the admin - instead they saw the generic failure message which "points them in the wrong direction". This patch shows the py3 missing message Signed-off-by: Paul Cuzner (cherry picked from commit 9e27995bb0a7de0072742e5f18926343acf80e05) --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 70de61937e9a..21108220add2 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1032,7 +1032,10 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): self._reset_con(host) user = self.ssh_user if self.mode == 'root' else 'cephadm' - msg = f'''Failed to connect to {host} ({addr}). + if str(e).startswith("Can't communicate"): + msg = str(e) + else: + msg = f'''Failed to connect to {host} ({addr}). Please make sure that the host is reachable and accepts connections using the cephadm SSH key To add the cephadm SSH key to the host: