From b2483abb00d15c98f39326def64209bf90f1edef Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Fri, 8 Nov 2024 08:23:38 -0500 Subject: [PATCH] fix: move key access inside falsy check Otherwise, this fails when trying to create a new image. Signed-off-by: Ralph Bean --- pyxis/create_container_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyxis/create_container_image.py b/pyxis/create_container_image.py index 5306d50..c990e49 100755 --- a/pyxis/create_container_image.py +++ b/pyxis/create_container_image.py @@ -370,9 +370,9 @@ def main(): # pragma: no cover # First check if it exists at all image = image_already_exists(args, args.architecture_digest, repository=None) - identifier = image["_id"] if image: # Then, check if it exists in association with the given repository + identifier = image["_id"] if image_already_exists(args, args.architecture_digest, repository=args.name): LOGGER.info( f"Image with given docker_image_digest already exists as {identifier} "