summaryrefslogtreecommitdiffstats
path: root/bitbake/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:54 +0100
commite89db137f008d7ead4e8ba81e704388eae69d7e4 (patch)
tree12e5df1984b98bfab52b32dc638026663bc0a3e0 /bitbake/bin/bitbake
parenta5d01e9ec7176ad16e106b100861b488bc22081f (diff)
downloadpoky-e89db137f008d7ead4e8ba81e704388eae69d7e4.tar.gz
bitbake: 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. (Bitbake rev: eb63f08c33644f64752aaae2146a000956ce894a) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/bin/bitbake')
-rwxr-xr-xbitbake/bin/bitbake23
1 files changed, 13 insertions, 10 deletions
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index fcfe0434ce..ab881c537d 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -332,26 +332,29 @@ def main():
332 server = servermodule.BitBakeXMLRPCClient(configParams.observe_only) 332 server = servermodule.BitBakeXMLRPCClient(configParams.observe_only)
333 server.saveConnectionDetails(configParams.remote_server) 333 server.saveConnectionDetails(configParams.remote_server)
334 334
335 def _getServerConnection(server, featureset):
336 try:
337 server_connection = server.establishConnection(featureset)
338 except Exception as e:
339 bb.fatal("Could not connect to server %s: %s" % (configParams.remote_server, str(e)))
340 return server_connection
341
335 if not configParams.server_only: 342 if not configParams.server_only:
336 if configParams.status_only: 343 if configParams.status_only:
337 try: 344 server_connection = _getServerConnection(server, featureset)
338 server_connection = server.establishConnection(featureset)
339 except:
340 sys.exit(1)
341 if not server_connection:
342 sys.exit(1)
343 server_connection.terminate() 345 server_connection.terminate()
344 sys.exit(0) 346 sys.exit(0)
345 347
346 # Setup a connection to the server (cooker) 348 # Setup a connection to the server (cooker)
347 server_connection = server.establishConnection(featureset) 349 try:
348 if not server_connection: 350 server_connection = server.establishConnection(featureset)
351 except:
349 if configParams.kill_server: 352 if configParams.kill_server:
350 bb.fatal("Server already killed") 353 bb.fatal("Server already offline")
351 configParams.bind = configParams.remote_server 354 configParams.bind = configParams.remote_server
352 start_server(servermodule, configParams, configuration, featureset) 355 start_server(servermodule, configParams, configuration, featureset)
353 bb.event.ui_queue = [] 356 bb.event.ui_queue = []
354 server_connection = server.establishConnection(featureset) 357 server_connection = _getServerConnection(server, featureset)
355 358
356 # Restore the environment in case the UI needs it 359 # Restore the environment in case the UI needs it
357 for k in cleanedvars: 360 for k in cleanedvars: