diff options
author | Christopher Larson <chris_larson@mentor.com> | 2012-10-29 13:01:23 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-11-01 11:46:22 +0000 |
commit | c1c20c02a0eb808a099bebfcc7e90188baa22ba4 (patch) | |
tree | fea4ff816120e77b9e8b5bc547703478387e067d /meta/recipes-core/netbase | |
parent | 99fa251b5696dff77358d514175bbb08802a7a02 (diff) | |
download | poky-c1c20c02a0eb808a099bebfcc7e90188baa22ba4.tar.gz |
bitbake: command: add error to return of runCommand
Currently, command.py can return an error message from runCommand, due to
being unable to run the command, yet few of our UIs (just hob) can handle it
today. This can result in seeing a TypeError with traceback in certain rare
circumstances.
To resolve this, we need a clean way to get errors back from runCommand,
without having to isinstance() the return value. This implements such a thing
by making runCommand also return an error (or None if no error occurred).
As runCommand now has a method of returning errors, we can also alter the
getCmdLineAction bits such that the returned value is just the action, not an
additional message. If a sync command wants to return an error, it raises
CommandError(message), and the message will be passed to the caller
appropriately.
Example Usage:
result, error = server.runCommand(...)
if error:
log.error('Unable to run command: %s' % error)
return 1
(Bitbake rev: 717831b8315cb3904d9b590e633000bc897e8fb6)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/netbase')
0 files changed, 0 insertions, 0 deletions