From 6f067d0fcbd18c6ddcb3d74e25fc1cecce557ec0 Mon Sep 17 00:00:00 2001 From: NitzanMordhai Date: Wed, 4 Mar 2026 14:08:54 +0000 Subject: [PATCH] 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) --- src/pybind/mgr/orchestrator/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.47.3