summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server/process.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2012-10-29 13:01:23 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-12-07 17:25:54 +0000
commit3b9a640f8d19cd50d64ae2722304ace80453149e (patch)
treec62c9a85e3dea9580d1d88b0579594c6e57ac524 /bitbake/lib/bb/server/process.py
parenta2100b9b9d06c88f3791620729f64c39f8443f64 (diff)
downloadpoky-3b9a640f8d19cd50d64ae2722304ace80453149e.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: d1002e33e05d45a7e1bd65d79537419a4057e43a) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r--bitbake/lib/bb/server/process.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index ba9133639d..3ae9ede6b6 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -48,7 +48,7 @@ class ServerCommunicator():
48 if self.connection.poll(.5): 48 if self.connection.poll(.5):
49 return self.connection.recv() 49 return self.connection.recv()
50 else: 50 else:
51 return None 51 return None, "Timeout while attempting to communicate with bitbake server"
52 except KeyboardInterrupt: 52 except KeyboardInterrupt:
53 pass 53 pass
54 54