]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cephadm: fix host-maintenance command always exiting with a failure 59454/head
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 27 Mar 2024 22:45:15 +0000 (18:45 -0400)
committerAdam King <adking@redhat.com>
Tue, 27 Aug 2024 14:03:59 +0000 (10:03 -0400)
commitb2db6c41af18d61196d9d2bb72d1737538ce11bb
tree50f425ac9670174a6b6fe2fb5b9543b0f06c319d
parentfe43f1c9f9e2945dda7244d8acbd33fb921449af
cephadm: fix host-maintenance command always exiting with a failure

The host-maintenance command would always fail because
command_maintenance always returns a string. This string is passed to
sys.exit and thus always gets printed and causes a non-zero exit code.
Fix the command line behavior by renaming the original function and
adding a new command_maintenance that prints the string and returns an
int like other command_* functions do.

Fixes: https://tracker.ceph.com/issues/65122
Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 0a137b140e47d02b03d133adb55e62aa0de7b984)
src/cephadm/cephadm.py
src/cephadm/tests/test_cephadm.py