scripts: west: add subprocess.call wrapper to runner classes

There's a use case for it in intel_s1000.py

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
This commit is contained in:
Marti Bolivar 2018-05-09 21:56:11 -04:00 committed by Anas Nashif
parent a81f0559c3
commit bc587d9262

View File

@ -397,6 +397,21 @@ class ZephyrBinaryRunner(abc.ABC):
server_proc.terminate()
server_proc.wait()
def call(self, cmd):
'''Subclass subprocess.call() wrapper.
Subclasses should use this method to run command in a
subprocess and get its return code, rather than
using subprocess directly, to keep accurate debug logs.
'''
if DEBUG or self.debug:
print(quote_sh_list(cmd))
if DEBUG:
return 0
return subprocess.call(cmd)
def check_call(self, cmd):
'''Subclass subprocess.check_call() wrapper.