]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: add useful error if python3 is not on remote host
authorDaniel-Pivonka <dpivonka@redhat.com>
Fri, 27 Mar 2020 18:38:41 +0000 (14:38 -0400)
committerDaniel-Pivonka <dpivonka@redhat.com>
Mon, 30 Mar 2020 18:51:53 +0000 (14:51 -0400)
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 <dpivonka@redhat.com>
src/pybind/mgr/cephadm/module.py

index 7e89a365500f4d2748a3ef6e21d227c0b45a26df..52af3acfb9cf1102483973af7e27441c14e5033e 100644 (file)
@@ -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: