]> 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)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 28 Mar 2024 14:39:06 +0000 (10:39 -0400)
commit0a137b140e47d02b03d133adb55e62aa0de7b984
tree92a7cb3786a413b6bc588873e820b54538eb517e
parentcde5beea7ba05ac896a15f49650beb0d08c0142f
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>
src/cephadm/cephadm.py
src/cephadm/tests/test_cephadm.py