]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephadm: avoid crashing on expected non-zero exit
authorMoritz Röhrich <moritz.rohrich@suse.com>
Mon, 21 Mar 2022 16:32:25 +0000 (17:32 +0100)
committerAdam King <adking@redhat.com>
Tue, 3 May 2022 00:48:33 +0000 (20:48 -0400)
commitb5e6483e6069d48d5c76209c16af24de7d08e580
treeb3830b592a9d76f10307c8013e9cc3cd2647a27c
parent8cff011366c218c6425efad8f65f473556f30d9b
cephadm: avoid crashing on expected non-zero exit

- Avoid crashing when a call out to an external program expectedly does
  not return exit status zero.

There are programs that communicate other information than error/no
error through exit status. E.g. `systemctl status` will return different
exit codes depending on the actual status of the units in question.
In cases where this is expected crashing with a RuntimeError exception
is inappropriate and should be avoided.

Fixes: https://tracker.ceph.com/issues/55117
Signed-off-by: Moritz Röhrich <moritz.rohrich@suse.com>
(cherry picked from commit a02be6f22fa18094cd8758700ab74581b6ce1701)
qa/workunits/cephadm/test_cephadm.sh
src/cephadm/cephadm