提交 b8cc45a5 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!14 force clean container

Merge pull request !14 from haozi007/work
......@@ -616,21 +616,6 @@ out:
return bret;
}
static bool lcr_check_container_stopped(struct lxc_container *c, const char *name)
{
if (!is_container_can_control(c)) {
ERROR("Insufficent privileges to control");
return false;
}
if (c->is_running(c)) {
ERROR("Container is still running");
lcr_set_error_message(LCR_ERR_RUNTIME, "Container is still running:%s", name);
return false;
}
return true;
}
bool lcr_clean(const char *name, const char *lcrpath, const char *logpath, const char *loglevel, pid_t pid)
{
struct lxc_container *c = NULL;
......@@ -667,7 +652,8 @@ bool lcr_clean(const char *name, const char *lcrpath, const char *logpath, const
goto out_put;
}
if (!lcr_check_container_stopped(c, name)) {
if (!is_container_can_control(c)) {
ERROR("Insufficent privileges to control");
bret = false;
goto out_put;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册