]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: prevent traceback when invalid osd id passed to 'orch osd rm stop'
authorDaniel Pivonka <dpivonka@redhat.com>
Mon, 8 Mar 2021 19:04:29 +0000 (14:04 -0500)
committerSage Weil <sage@newdream.net>
Tue, 16 Mar 2021 12:56:17 +0000 (07:56 -0500)
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 <dpivonka@redhat.com>
(cherry picked from commit 6e8adcfee6ef8996badac3167007b6c76e33a2e4)

src/pybind/mgr/cephadm/module.py

index 4b162b2a50959c8877548cde39f719df9b33a105..6e7398d660c9c244a65bbab2aae6b5877138c532 100644 (file)
@@ -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