From: Daniel Pivonka Date: Mon, 8 Mar 2021 19:04:29 +0000 (-0500) Subject: mgr/cephadm: prevent traceback when invalid osd id passed to 'orch osd rm stop' X-Git-Tag: v17.1.0~2677^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6e8adcfee6ef8996badac3167007b6c76e33a2e4;p=ceph.git mgr/cephadm: prevent traceback when invalid osd id passed to 'orch osd rm stop' orch osd rm exepcts a str that can be converted to an int passed to it if the user passed something that cant be converted it shows a traceback catching the ValueError prevents this traceback. Signed-off-by: Daniel Pivonka --- diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index 4b162b2a5095..6e7398d660c9 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2286,7 +2286,7 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule, try: self.to_remove_osds.rm(OSD(osd_id=int(osd_id), remove_util=self.to_remove_osds.rm_util)) - except (NotFoundError, KeyError): + except (NotFoundError, KeyError, ValueError): return f'Unable to find OSD in the queue: {osd_id}' # trigger the serve loop to halt the removal