summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-21 21:45:16 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-23 09:31:42 +0100
commita4f077b1fe28994b3180a49a969a6d044b5114e1 (patch)
treed2684ddb3968d5d194eaabe7ee18ba750ee41c16 /bitbake/lib
parentdb50630948394bdcd361f3511af40c1896b1a017 (diff)
downloadast2050-yocto-poky-a4f077b1fe28994b3180a49a969a6d044b5114e1.zip
ast2050-yocto-poky-a4f077b1fe28994b3180a49a969a6d044b5114e1.tar.gz
bitbake: knotty: Improve exception handling
Currently, IOErrors are just passed over due to the broken Exception clause. A command like "bitbake X | <invalid command>" would break stdout triggering a traceback. With these changes we print the exceptions, shut down the server gracefully and exit which is a much nicer behaviour and is less confusion to the user. (Bitbake rev: 9544108f7b413038d871ce6ca88232de2f2434d9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/ui/knotty.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 746dcf4..bb6d4cb 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -508,6 +508,10 @@ def main(server, eventHandler, params, tf = TerminalFilter):
# ignore interrupted io
if ioerror.args[0] == 4:
pass
+ sys.stderr.write(str(ioerror))
+ if not params.observe_only:
+ _, error = server.runCommand(["stateForceShutdown"])
+ main.shutdown = 2
except KeyboardInterrupt:
termfilter.clearFooter()
if params.observe_only:
@@ -526,7 +530,11 @@ def main(server, eventHandler, params, tf = TerminalFilter):
logger.error("Unable to cleanly shutdown: %s" % error)
main.shutdown = main.shutdown + 1
pass
-
+ except Exception as e:
+ sys.stderr.write(str(e))
+ if not params.observe_only:
+ _, error = server.runCommand(["stateForceShutdown"])
+ main.shutdown = 2
summary = ""
if taskfailures:
summary += pluralise("\nSummary: %s task failed:",
OpenPOWER on IntegriCloud