From e34fa5cbb2486d22aa3888841c17de8b70c81393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 24 Mar 2025 18:03:32 +0100 Subject: [PATCH] Allow to define a container_runtime_path --- dangerzone/container_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dangerzone/container_utils.py b/dangerzone/container_utils.py index bbdb75a..13641a2 100644 --- a/dangerzone/container_utils.py +++ b/dangerzone/container_utils.py @@ -1,4 +1,5 @@ import logging +import os import platform import shutil import subprocess @@ -26,6 +27,11 @@ def get_runtime() -> str: container_tech = get_runtime_name() runtime = shutil.which(container_tech) if runtime is None: + # Fallback to the container runtime path from the settings + settings = Settings() + runtime_path = settings.get("container_runtime_path") + if os.path.exists(runtime_path): + return runtime_path raise errors.NoContainerTechException(container_tech) return runtime