From c219160b8f797e0bad36b048cabce7acb3d7cac5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 21 Feb 2024 17:18:34 +0100 Subject: [PATCH] osbuild: add warning when lazy umount in containers_storage_source fails --- osbuild/util/containers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osbuild/util/containers.py b/osbuild/util/containers.py index 7acca373..0e0f801b 100644 --- a/osbuild/util/containers.py +++ b/osbuild/util/containers.py @@ -132,7 +132,9 @@ def containers_storage_source(image, image_filepath, container_format): if driver == "overlay": # NOTE: the overlay sub-directory isn't always released, # so we need to force unmount it - subprocess.run(["umount", "-f", "--lazy", os.path.join(storage_path, "overlay")], check=False) + ret = subprocess.run(["umount", "-f", "--lazy", os.path.join(storage_path, "overlay")], check=False) + if ret.returncode != 0: + print(f"WARNING: umount of overlay dir failed with an error: {ret}") @contextmanager