From d8d23757e98e040a9a5e2b5ec030ed73a0fa3292 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Fri, 14 Feb 2020 11:42:14 +0100 Subject: [PATCH] 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 --- src/pybind/mgr/cephadm/module.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index a64d046315e..190439d701b 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 -- 2.39.5