mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 09:52:37 +02:00
Allow to define a container_runtime_path
This commit is contained in:
parent
f082641b71
commit
20cd9cfc5c
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue