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):
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']

View File

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