Merge pull request #21 from zhongyehong/stopbug

Stopbug
This commit is contained in:
leebaok 2016-04-06 11:00:27 +08:00
commit fa56ab7ab3
2 changed files with 3 additions and 3 deletions

View File

@ -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']

View File

@ -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"):