From c312420aba03311a29c645d0062276aead9801d8 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 13 Dec 2021 11:37:19 -0800 Subject: [PATCH] Ignore exceptions when there's an error deleting an old container image --- dangerzone/global_common.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dangerzone/global_common.py b/dangerzone/global_common.py index 3ab8886..884f286 100644 --- a/dangerzone/global_common.py +++ b/dangerzone/global_common.py @@ -482,11 +482,14 @@ class GlobalCommon(object): elif found_image_id == "": pass else: - print(f"Deleting old dangerzone container image") + print("Deleting old dangerzone container image") - subprocess.check_output( - [self.get_container_runtime(), "rmi", "--force", found_image_id], - startupinfo=self.get_subprocess_startupinfo(), - ) + try: + subprocess.check_output( + [self.get_container_runtime(), "rmi", "--force", found_image_id], + startupinfo=self.get_subprocess_startupinfo(), + ) + except: + print("Couldn't delete old container image, so leaving it there") return installed