]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/cephadm: add_host: Convert HostNotFound to OrchestratorError
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 14 Feb 2020 10:42:14 +0000 (11:42 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 18 Feb 2020 13:37:14 +0000 (14:37 +0100)
Don't bother users with Python Tracebacks.

Fixes: https://tracker.ceph.com/issues/44026
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/cephadm/module.py

index a64d046315e4dea67a16bc1498fa09ab2b47c257..190439d701baf017ad191e6e533f61c403068638 100644 (file)
@@ -38,6 +38,7 @@ from . import remotes
 try:
     import remoto
     import remoto.process
+    import execnet.gateway_bootstrap
 except ImportError as e:
     remoto = None
     remoto_import_error = str(e)
@@ -1172,6 +1173,9 @@ class CephadmOrchestrator(MgrModule, orchestrator.OrchestratorClientMixin):
                         code, '\n'.join(err)))
             return out, err, code
 
+        except execnet.gateway_bootstrap.HostNotFound as e:
+            raise OrchestratorError('New host %s (%s) failed to connect: `ssh %s`' % (
+                host, addr, str(e))) from e
         except Exception as ex:
             self.log.exception(ex)
             raise