]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: replace call_throws with call in command_inspect_image 68538/head
authoryaelazulay-redhat <yaelazulay@redhat.com>
Wed, 22 Apr 2026 06:37:57 +0000 (09:37 +0300)
committeryaelazulay-redhat <yaelazulay@redhat.com>
Mon, 27 Apr 2026 16:05:03 +0000 (19:05 +0300)
Problem:
During the upgrade, when inspecting the new ceph image for the first time, an error is printed to the ceph-mgr log instead of displaying a user-friendly message.

Root cause: During an upgrade, inspect-image is called on each node to check if the target image exists locally before pulling it. This flow, where inspect-image always precedes the pull, occurs on nodes other than the first.

Code Fixes:
1. src/cephadm/cephadm.py:
   Replace call_throws with call in command_inspect_image. call_throws raises a RuntimeError on any non-zero exit code, producing a full traceback in the logs. call returns the exit code instead of raising, so the function exits cleanly with errno.ENOENT when the image is not found.

Fixes: https://tracker.ceph.com/issues/75448
Signed-off-by: Yael Azulay <yazulay@redhat.com>
src/cephadm/cephadm.py

index 7038d4214c8c73108c737e6222079e68cdec9f1b..cb51e4a350f5e4296a9d0e5d7236c2a1799f7602 100755 (executable)
@@ -2044,7 +2044,7 @@ def _pull_image(ctx, image, insecure=False):
 @infer_image
 def command_inspect_image(ctx):
     # type: (CephadmContext) -> int
-    out, err, ret = call_throws(ctx, [
+    out, err, ret = call(ctx, [
         ctx.container_engine.path, 'inspect',
         '--format', '{{.ID}},{{.RepoDigests}}',
         ctx.image])