From 0b9c11cb9892bee9c6c41e16c2f978a5600b02ee Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 25 Jan 2021 16:32:45 -0600 Subject: [PATCH] cephadm: fix 'inspect' and 'pull' With podman 2.2.1 I would get ERRO[0000] Error printing inspect output: template: all inspect:1: function "json" not defined Removing the 'json' portion of the query resolves it. Signed-off-by: Sage Weil (cherry picked from commit d31bed79411ca493ec48eeed4e9cbb7ad92295c3) --- src/cephadm/cephadm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 96ab0550fa7d2..9d7bd2c5d53b5 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -3157,7 +3157,7 @@ def command_inspect_image(ctx): # type: (CephadmContext) -> int out, err, ret = call_throws(ctx, [ ctx.container_path, 'inspect', - '--format', '{{.ID}},{{json .RepoDigests}}', + '--format', '{{.ID}},{{.RepoDigests}}', ctx.image]) if ret: return errno.ENOENT @@ -3179,7 +3179,7 @@ def get_image_info_from_inspect(out, image): 'image_id': normalize_container_id(image_id) } if digests: - json_digests = json.loads(digests) + json_digests = digests[1:-1].split(' ') if json_digests: r['repo_digest'] = json_digests[0] return r -- 2.39.5