diff options
Diffstat (limited to 'bitbake/bin')
-rwxr-xr-x | bitbake/bin/bitbake | 23 |
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(): 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: |