]> git.apps.os.sepia.ceph.com Git - ceph.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)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 7 Apr 2020 09:36:27 +0000 (11:36 +0200)
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>
(cherry picked from commit bb4554a3a67c4fc29b5dad597fbb880ea52394ac)

src/pybind/mgr/cephadm/module.py

index 783665c94b9ba8cb4125dd8b4ed6c4e67a55af26..73fc0c895e7cc8593740b4a0f00e592617f58aea 100644 (file)
@@ -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: