From: Daniel-Pivonka Date: Fri, 27 Mar 2020 18:38:41 +0000 (-0400) Subject: mgr/cephadm: add useful error if python3 is not on remote host X-Git-Tag: v16.1.0~2719^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bb4554a3a67c4fc29b5dad597fbb880ea52394ac;p=ceph.git 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 --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 7e89a365500f..52af3acfb9cf 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: