commit
fa56ab7ab3
|
@ -255,7 +255,7 @@ IP=%s
|
|||
def container_status(self, lxc_name):
|
||||
if not self.is_container(lxc_name):
|
||||
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])
|
||||
if Ret.returncode == 0:
|
||||
return [True, 'running']
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
import env,subprocess,os,time
|
||||
from log import logger
|
||||
|
||||
def sys_run(command):
|
||||
Ret = subprocess.run(command, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell=True, check=False)
|
||||
def sys_run(command,check=False):
|
||||
Ret = subprocess.run(command, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell=True, check=check)
|
||||
return Ret
|
||||
|
||||
def new_group(group_name, size = "5000", file_path = "/opt/docklet/local/docklet-storage"):
|
||||
|
|
Loading…
Reference in New Issue