From 318eaf2bfdb81d7cf2e31fe9c7b6e215e3522e77 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 31 Jul 2025 20:26:11 +0200 Subject: op-mode: T7403: fix image deletion when a single image ID is provided Commit a99ca6d11 ("op-mode: T7403: add option for forcefully removing a container image") did not account for the case where a single image ID is passed as a string. This led to incorrect behavior during iteration. Without converting the string to a list, the code iterates over individual characters of the image ID rather than treating it as a single item. As a result, the system attempts to delete non-existent container images based on these characters. --- src/op_mode/container.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/op_mode/container.py b/src/op_mode/container.py index feb9f41cc..2dc7ce4ec 100755 --- a/src/op_mode/container.py +++ b/src/op_mode/container.py @@ -76,6 +76,9 @@ def delete_image(name: str, force: typing.Optional[bool] = False): name = name.replace('\n', ' ') # convert to list name = name.split() + else: + # convert str -> list for further processing down the line + name = [name] for image in name: # convert the truncated image ID to a full image ID -- cgit v1.2.3