From e31ab567e4d839efd88248cc1fffb67e1dd563f6 Mon Sep 17 00:00:00 2001 From: Paul Cuzner Date: Fri, 18 Dec 2020 14:45:07 +1300 Subject: [PATCH] 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) --- src/pybind/mgr/cephadm/module.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 70de61937e9a0..21108220add22 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: -- 2.39.5