示例#1
0
文件: repy.py 项目: m3z/ToMaTo
def getState(host, vmid):
	assert vmid
	if process.processRunning(host, _pidFile(vmid), "python"):
		return generic.State.STARTED
	if fileutil.existsFile(host, _imagePath(vmid)):
		return generic.State.PREPARED
	return generic.State.CREATED
示例#2
0
文件: vtun.py 项目: david-hock/ToMaTo
def getState(host, port):
	assert host
	if not fileutil.existsFile(host, _configPath(port)):
		return generic.State.CREATED
	if not fileutil.existsFile(host, _pidFile(port)):
		return generic.State.PREPARED
	if not process.processRunning(host, _pidFile(port), "vtund"):
		return generic.State.PREPARED
	return generic.State.STARTED
示例#3
0
文件: tinc.py 项目: joanmarkt/ToMaTo
def getState(endpoint):
	assert _isEndpoint(endpoint)
	host = endpoint.getHost()
	assert host
	if not fileutil.existsDir(host, _configDir(endpoint)):
		return generic.State.CREATED
	if not fileutil.existsFile(host, _pidFile(endpoint)):
		return generic.State.PREPARED
	if not process.processRunning(host, _pidFile(endpoint), "tincd"):
		return generic.State.PREPARED
	return generic.State.STARTED
示例#4
0
def captureViaNetRunning(host, name="_dummy"):
	return process.processRunning(host, "%s.net.pid" % _remoteDir(name), "tcpserver")
示例#5
0
def captureToFileRunning(host, name="_dummy"):
	return process.processRunning(host, "%s.file.pid" % _remoteDir(name), "tcpdump")
示例#6
0
文件: vzctl.py 项目: m3z/ToMaTo
def vncRunning(host, vmid, port):
	return process.processRunning(host, _vncPidfile(vmid), "vncterm")
示例#7
0
文件: qm.py 项目: joanmarkt/ToMaTo
def vncRunning(host, vmid, port):
	return process.processRunning(host, _vncPidfile(vmid), "tcpserver")