commit
fa56ab7ab3
|
@ -255,7 +255,7 @@ IP=%s
|
||||||
def container_status(self, lxc_name):
|
def container_status(self, lxc_name):
|
||||||
if not self.is_container(lxc_name):
|
if not self.is_container(lxc_name):
|
||||||
return [False, "container not found"]
|
return [False, "container not found"]
|
||||||
Ret = sys_run("lxc-info -n %s | grep RUNNING")
|
Ret = sys_run("lxc-info -n %s | grep RUNNING" % lxc_name)
|
||||||
#status = subprocess.call([self.libpath+"/lxc_control.sh", "status", lxc_name])
|
#status = subprocess.call([self.libpath+"/lxc_control.sh", "status", lxc_name])
|
||||||
if Ret.returncode == 0:
|
if Ret.returncode == 0:
|
||||||
return [True, 'running']
|
return [True, 'running']
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
import env,subprocess,os,time
|
import env,subprocess,os,time
|
||||||
from log import logger
|
from log import logger
|
||||||
|
|
||||||
def sys_run(command):
|
def sys_run(command,check=False):
|
||||||
Ret = subprocess.run(command, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell=True, check=False)
|
Ret = subprocess.run(command, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell=True, check=check)
|
||||||
return Ret
|
return Ret
|
||||||
|
|
||||||
def new_group(group_name, size = "5000", file_path = "/opt/docklet/local/docklet-storage"):
|
def new_group(group_name, size = "5000", file_path = "/opt/docklet/local/docklet-storage"):
|
||||||
|
|
Loading…
Reference in New Issue