From bb4554a3a67c4fc29b5dad597fbb880ea52394ac 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 --- 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 7e89a365500..52af3acfb9c 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -1514,7 +1514,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