]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cephadm: fix host-maintenance command always exiting with a failure
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 27 Mar 2024 22:45:15 +0000 (18:45 -0400)
committerAdam King <adking@redhat.com>
Mon, 15 Apr 2024 15:27:15 +0000 (11:27 -0400)
commit42f0031fee27a0d43f7e549484dc15cc8f1ab529
treea6b263c8cffee90bc03881de60a118466358ac16
parentfa42f984917afe1cd5716bd172c62407aa1a9142
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