ya2 · news · projects · code · about

refactoring of functional tests
[pmachines.git] / lib / tools / kill_yorg_server.py
CommitLineData
8ee66edd
FC
1# this kills yocto's server
2from subprocess import Popen, PIPE
3from os import system
4
5
6def exec_cmd(cmd):
7 ret = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True).communicate()
8 return '\n'.join(ret)
9
10
11grep = "grep -E 'python.*server.*yocto.*main.py|python.*yocto.*server.*main.py'"
12proc_line = exec_cmd('ps aux | ' + grep).split('\n')[0]
13srv_pid = proc_line.split()[1]
14system('kill -9 ' + srv_pid)