From 506ed57ca644c8d2c23d975a709d254a6c6c8837 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Wed, 27 May 2015 17:25:17 +0100 Subject: [PATCH] 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. --- wlauto/utils/misc.py | 4 ++-- wlauto/workloads/telemetry/__init__.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wlauto/utils/misc.py b/wlauto/utils/misc.py index 40261ff8..121fac68 100644 --- a/wlauto/utils/misc.py +++ b/wlauto/utils/misc.py @@ -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 diff --git a/wlauto/workloads/telemetry/__init__.py b/wlauto/workloads/telemetry/__init__.py index eb738598..2201841a 100644 --- a/wlauto/workloads/telemetry/__init__.py +++ b/wlauto/workloads/telemetry/__init__.py @@ -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: