From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 5/5] oeqa/utils/commands.py: Command class improve validations/decoding in output
Date: Thu, 28 Jul 2016 09:34:31 -0500 [thread overview]
Message-ID: <579A17F7.7040602@linux.intel.com> (raw)
In-Reply-To: <f10cdb53-0628-e44a-2c42-c0b488171a3a@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1557 bytes --]
On 07/27/2016 10:18 PM, Leonardo Sandoval wrote:
> Hi Anibal,
>
>
> El 07/27/2016 a las 05:40 PM, Aníbal Limón escribió:
>> When run a command sometimes the output isn't provided so validate
> I wonder if this problem is related to a timeout, so at some point this
> is reached and no output is shown.
This could be one scenario but the output needs to be validated in order
to don't crash trying to use a None var.
alimon
>> 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]
>>
>> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
>> ---
>> meta/lib/oeqa/utils/commands.py | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/lib/oeqa/utils/commands.py
>> b/meta/lib/oeqa/utils/commands.py
>> index 4f79d15..a8e184d 100644
>> --- a/meta/lib/oeqa/utils/commands.py
>> +++ b/meta/lib/oeqa/utils/commands.py
>> @@ -78,7 +78,10 @@ class Command(object):
>> self.process.kill()
>> self.thread.join()
>> - self.output = self.output.decode("utf-8").rstrip()
>> + if not self.output:
>> + self.output = ""
>> + else:
>> + self.output = self.output.decode("utf-8",
>> errors='replace').rstrip()
>> self.status = self.process.poll()
>> self.log.debug("Command '%s' returned %d as exit code." %
>> (self.cmd, self.status))
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2016-07-28 14:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-27 22:40 [PATCH 0/5] Fixes for busybox-syslog with systemd Aníbal Limón
2016-07-27 22:40 ` [PATCH 1/5] oeqa/runtime/syslog.py: Improve test_syslog_logger Aníbal Limón
2016-07-27 22:40 ` [PATCH 2/5] busybox-syslog.default: When systemd is enabled don't use circular buffer Aníbal Limón
2016-07-27 22:40 ` [PATCH 3/5] classes/testimage: When image is systemd, enable debug log level Aníbal Limón
2016-07-27 22:40 ` [PATCH 4/5] oeqa/runtime/syslog: test_syslog_logger Don't try to use logread when systemd is enabled Aníbal Limón
2016-07-27 22:40 ` [PATCH 5/5] oeqa/utils/commands.py: Command class improve validations/decoding in output Aníbal Limón
2016-07-28 3:18 ` Leonardo Sandoval
2016-07-28 14:34 ` Aníbal Limón [this message]
2016-07-29 7:08 ` [PATCH 0/5] Fixes for busybox-syslog with systemd Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=579A17F7.7040602@linux.intel.com \
--to=anibal.limon@linux.intel.com \
--cc=leonardo.sandoval.gonzalez@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.