From 65022b926f6c311c1eb1e582d7e07e6a2e3c8190 Mon Sep 17 00:00:00 2001 From: Daniel-Pivonka Date: Fri, 27 Mar 2020 14:38:41 -0400 Subject: [PATCH] mgr/cephadm: add useful error if python3 is not on remote host show 'Error ENOENT: New host example (example) failed check: ["Can't communicate with remote host, possibly because python3 is not installed there"]' instead of traceback with OSError: cannot send(already closed?) when adding host if python3 is not on host Signed-off-by: Daniel-Pivonka (cherry picked from commit bb4554a3a67c4fc29b5dad597fbb880ea52394ac) --- src/pybind/mgr/cephadm/module.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 783665c94b9ba..73fc0c895e7cc 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1566,7 +1566,13 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule): addr = self.inventory[host].get('addr', host) try: - conn, connr = self._get_connection(addr) + try: + conn, connr = self._get_connection(addr) + except IOError as e: + if error_ok: + self.log.exception('failed to establish ssh connection') + return [], [str("Can't communicate with remote host, possibly because python3 is not installed there")], 1 + raise assert image or entity if not image: -- 2.39.5