From: Sebastian Wagner Date: Fri, 14 Feb 2020 10:42:14 +0000 (+0100) Subject: mgr/cephadm: add_host: Convert HostNotFound to OrchestratorError X-Git-Tag: v15.1.1~364^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d8d23757e98e040a9a5e2b5ec030ed73a0fa3292;p=ceph.git mgr/cephadm: add_host: Convert HostNotFound to OrchestratorError Don't bother users with Python Tracebacks. Fixes: https://tracker.ceph.com/issues/44026 Signed-off-by: Sebastian Wagner --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index a64d046315e4..190439d701ba 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -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