From 11d17bf21a134ffb4c259da19c4cd0f25c74ccd3 Mon Sep 17 00:00:00 2001 From: DDSRem <1448139087@qq.com> Date: Thu, 28 Sep 2023 19:57:28 +0800 Subject: [PATCH] fix: https://github.com/jxxghp/MoviePilot/pull/654 --- app/utils/system.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/utils/system.py b/app/utils/system.py index 3b198bf1..f661b403 100644 --- a/app/utils/system.py +++ b/app/utils/system.py @@ -354,6 +354,12 @@ class SystemUtils: index_second_slash = data.rfind("/", 0, index_resolv_conf) index_first_slash = data.rfind("/", 0, index_second_slash) + 1 container_id = data[index_first_slash:index_second_slash] + if len(container_id) < 20: + index_resolv_conf = data.find("/sys/fs/cgroup/devices") + if index_resolv_conf != -1: + index_second_slash = data.rfind(" ", 0, index_resolv_conf) + index_first_slash = data.rfind("/", 0, index_second_slash) + 1 + container_id = data[index_first_slash:index_second_slash] if not container_id: return False, "获取容器ID失败!" # 重启当前容器