From: NitzanMordhai Date: Wed, 4 Mar 2026 14:08:54 +0000 (+0000) Subject: pybind/orchestrator/cli: fix OrchestratorError retval sign X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F67515%2Fhead;p=ceph.git pybind/orchestrator/cli: fix OrchestratorError retval sign OrchestratorError stores errno as abs(), so e.errno is always positive. Returning retval=e.errno (+22) caused the ceph CLI to exit 0 since it only propagates the exit code when ret < 0. Fix by returning retval=-e.errno. Fixes: https://tracker.ceph.com/issues/75282 Signed-off-by: Nitzan Mordhai (cherry picked from commit 18546fa92a04f81ba0d85b57554e0291285fe02f) --- diff --git a/src/pybind/mgr/orchestrator/cli.py b/src/pybind/mgr/orchestrator/cli.py index 76f57fd37c22..4ef3fa58da46 100644 --- a/src/pybind/mgr/orchestrator/cli.py +++ b/src/pybind/mgr/orchestrator/cli.py @@ -18,7 +18,7 @@ class OrchestratorCLICommandBase(CLICommandBase): return func(*args, **kwargs) except (OrchestratorError, SpecValidationError) as e: # Do not print Traceback for expected errors. - return HandleCommandResult(retval=e.errno, stderr=str(e)) + return HandleCommandResult(retval=-e.errno, stderr=str(e)) except ImportError as e: return HandleCommandResult(retval=-errno.ENOENT, stderr=str(e)) except NotImplementedError: