]> 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>
Wed, 18 May 2022 19:42:45 +0000 (15:42 -0400)
commit94bdc00f83025e6bc00901d2af9c262c807a8ab8
treef1d0c18c90e8f4e964ef4edb8ff892c7c24ecab2
parent53cd85438c6a6cf97e4fd811da18324a4265a327
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