This commit is contained in:
@ -354,6 +354,12 @@ class SystemUtils:
|
|||||||
index_second_slash = data.rfind("/", 0, index_resolv_conf)
|
index_second_slash = data.rfind("/", 0, index_resolv_conf)
|
||||||
index_first_slash = data.rfind("/", 0, index_second_slash) + 1
|
index_first_slash = data.rfind("/", 0, index_second_slash) + 1
|
||||||
container_id = data[index_first_slash:index_second_slash]
|
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:
|
if not container_id:
|
||||||
return False, "获取容器ID失败!"
|
return False, "获取容器ID失败!"
|
||||||
# 重启当前容器
|
# 重启当前容器
|
||||||
|
Reference in New Issue
Block a user