diff options
| author | Aníbal Limón <anibal.limon@linux.intel.com> | 2016-07-27 17:40:42 -0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-01 11:47:13 +0100 |
| commit | 1981ab0829911ac91983babd1fab71093999b621 (patch) | |
| tree | ccfa35201886a4afd1ee2712e5b58da7dd2173ca /meta/lib/oeqa/utils/commands.py | |
| parent | 16485041989453aa8f847c44f68f1d6a085ab0fa (diff) | |
| download | poky-1981ab0829911ac91983babd1fab71093999b621.tar.gz | |
oeqa/utils/commands.py: Command class improve validations/decoding in output
When run a command sometimes the output isn't provided so validate
before trying to encode to utf-8, also some output like BIOS/EFI
contains characters that can't be codified into utf-8 for this reason
set errors='replace'.
[YOCTO #10019]
(From OE-Core rev: f2a04faf3c5d0a3cc562061b22e1c4873e1ca769)
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils/commands.py')
| -rw-r--r-- | meta/lib/oeqa/utils/commands.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 4f79d15bb8..a8e184d0c3 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py | |||
| @@ -78,7 +78,10 @@ class Command(object): | |||
| 78 | self.process.kill() | 78 | self.process.kill() |
| 79 | self.thread.join() | 79 | self.thread.join() |
| 80 | 80 | ||
| 81 | self.output = self.output.decode("utf-8").rstrip() | 81 | if not self.output: |
| 82 | self.output = "" | ||
| 83 | else: | ||
| 84 | self.output = self.output.decode("utf-8", errors='replace').rstrip() | ||
| 82 | self.status = self.process.poll() | 85 | self.status = self.process.poll() |
| 83 | 86 | ||
| 84 | self.log.debug("Command '%s' returned %d as exit code." % (self.cmd, self.status)) | 87 | self.log.debug("Command '%s' returned %d as exit code." % (self.cmd, self.status)) |
