summaryrefslogtreecommitdiffstats
path: root/bin/bitbake
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-06-04 15:47:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-06-06 10:32:28 +0100
commiteb63f08c33644f64752aaae2146a000956ce894a (patch)
tree539d643bf385752cdb736b3530c59d8184d424e0 /bin/bitbake
parentac5753274ff932e1d6f073ab4dab7bd6fe5355a1 (diff)
downloadbitbake-contrib-eb63f08c33644f64752aaae2146a000956ce894a.tar.gz
bitbake-contrib-eb63f08c33644f64752aaae2146a000956ce894a.tar.bz2
bitbake-contrib-eb63f08c33644f64752aaae2146a000956ce894a.zip
xmlrpc: client - remove fatal errors
When we use the XMLRPC client API to connect to a bitbake server, we want to receive errors from the API instead of having the API exiting without warning. Thus the "bb.fatal" calls have been replaced with "bb.warn" calls, and we re-raise the original exception for handling by the original caller. The bitbake starting script has been modified to properly test for failures in calling the client API and handle them. Additional error handling added in the client, as to prevent fatal crashes. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin/bitbake')
-rwxr-xr-xbin/bitbake23
1 files changed, 13 insertions, 10 deletions
diff --git a/bin/bitbake b/bin/bitbake
index fcfe0434ce..ab881c537d 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -332,26 +332,29 @@ def main():
server = servermodule.BitBakeXMLRPCClient(configParams.observe_only)
server.saveConnectionDetails(configParams.remote_server)
+ def _getServerConnection(server, featureset):
+ try:
+ server_connection = server.establishConnection(featureset)
+ except Exception as e:
+ bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e)))
+ return server_connection
+
if not configParams.server_only:
if configParams.status_only:
- try:
- server_connection = server.establishConnection(featureset)
- except:
- sys.exit(1)
- if not server_connection:
- sys.exit(1)
+ server_connection = _getServerConnection(server, featureset)
server_connection.terminate()
sys.exit(0)
# Setup a connection to the server (cooker)
- server_connection = server.establishConnection(featureset)
- if not server_connection:
+ try:
+ server_connection = server.establishConnection(featureset)
+ except:
if configParams.kill_server:
- bb.fatal("Server already killed")
+ bb.fatal("Server already offline")
configParams.bind = configParams.remote_server
start_server(servermodule, configParams, configuration, featureset)
bb.event.ui_queue = []
- server_connection = server.establishConnection(featureset)
+ server_connection = _getServerConnection(server, featureset)
# Restore the environment in case the UI needs it
for k in cleanedvars: