1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-20 20:09:11 +00:00

fix: telemetry: ignore all return codes

Telemetry seems to return random values as return code, so completely
ignore them and don't treat any values as errors.
This commit is contained in:
Sergei Trofimov 2015-05-27 17:25:17 +01:00
parent c31d4ec8a3
commit 506ed57ca6
2 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ def check_output(command, timeout=None, ignore=None, **kwargs):
ignore = []
elif isinstance(ignore, int):
ignore = [ignore]
elif not isinstance(ignore, list):
elif not isinstance(ignore, list) and ignore != 'all':
message = 'Invalid value for ignore parameter: "{}"; must be an int or a list'
raise ValueError(message.format(ignore))
if 'stdout' in kwargs:
@ -111,7 +111,7 @@ def check_output(command, timeout=None, ignore=None, **kwargs):
if retcode:
if retcode == -9: # killed, assume due to timeout callback
raise TimeoutError(command, output='\n'.join([output, error]))
elif retcode not in ignore:
elif ignore != 'all' and retcode not in ignore:
raise subprocess.CalledProcessError(retcode, command, output='\n'.join([output, error]))
return output, error

View File

@ -133,7 +133,7 @@ class Telemetry(Workload):
def run(self, context):
self.logger.debug(self.command)
self.raw_output, _ = check_output(self.command, shell=True, timeout=self.run_timeout, ignore=range(256))
self.raw_output, _ = check_output(self.command, shell=True, timeout=self.run_timeout, ignore='all')
def update_result(self, context): # pylint: disable=too-many-locals
if not self.raw_output: