Don't crash if the caller redirects the command output e.g. into a file, causing the "output" seen by runCmd to be None.
Signed-off-by: Markus Lehtonen <markus.lehto...@linux.intel.com> --- meta/lib/oeqa/utils/commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 2e513be..171c64f 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py @@ -78,14 +78,15 @@ class Command(object): self.process.kill() self.thread.join() - self.output = self.output.decode("utf-8").rstrip() + if self.output: + self.output = self.output.decode("utf-8").rstrip() self.status = self.process.poll() self.log.debug("Command '%s' returned %d as exit code." % (self.cmd, self.status)) # logging the complete output is insane # bitbake -e output is really big # and makes the log file useless - if self.status: + if self.status and self.output: lout = "\n".join(self.output.splitlines()[-20:]) self.log.debug("Last 20 lines:\n%s" % lout) -- 2.6.6 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core