process: Return proc in function helpers
Caller may want to access the proc object after running the process, for instance to check return code or inspect its stdout/stderr logs. Change-Id: I60a18dcf699ebeaced951f7d5ff188f573772282
This commit is contained in:
parent
c18c5b82ca
commit
12c5ea4a24
|
@ -399,16 +399,19 @@ def run_local_sync(run_dir, name, popen_args):
|
||||||
run_dir =run_dir.new_dir(name)
|
run_dir =run_dir.new_dir(name)
|
||||||
proc = Process(name, run_dir, popen_args)
|
proc = Process(name, run_dir, popen_args)
|
||||||
proc.launch_sync()
|
proc.launch_sync()
|
||||||
|
return proc
|
||||||
|
|
||||||
def run_local_netns_sync(run_dir, name, netns, popen_args):
|
def run_local_netns_sync(run_dir, name, netns, popen_args):
|
||||||
run_dir =run_dir.new_dir(name)
|
run_dir =run_dir.new_dir(name)
|
||||||
proc = NetNSProcess(name, run_dir, netns, popen_args)
|
proc = NetNSProcess(name, run_dir, netns, popen_args)
|
||||||
proc.launch_sync()
|
proc.launch_sync()
|
||||||
|
return proc
|
||||||
|
|
||||||
def run_remote_sync(run_dir, remote_user, remote_addr, name, popen_args, remote_cwd=None):
|
def run_remote_sync(run_dir, remote_user, remote_addr, name, popen_args, remote_cwd=None):
|
||||||
run_dir = run_dir.new_dir(name)
|
run_dir = run_dir.new_dir(name)
|
||||||
proc = RemoteProcess(name, run_dir, remote_user, remote_addr, remote_cwd, popen_args)
|
proc = RemoteProcess(name, run_dir, remote_user, remote_addr, remote_cwd, popen_args)
|
||||||
proc.launch_sync()
|
proc.launch_sync()
|
||||||
|
return proc
|
||||||
|
|
||||||
def scp(run_dir, remote_user, remote_addr, name, local_path, remote_path):
|
def scp(run_dir, remote_user, remote_addr, name, local_path, remote_path):
|
||||||
run_local_sync(run_dir, name, ('scp', '-r', local_path, '%s@%s:%s' % (remote_user, remote_addr, remote_path)))
|
run_local_sync(run_dir, name, ('scp', '-r', local_path, '%s@%s:%s' % (remote_user, remote_addr, remote_path)))
|
||||||
|
|
Loading…
Reference in New Issue