bitbake: xmlrpc: Show a better error message for connection failures

Showing a traceback when unable to connect to a bitbake server is
rather ugly. This change allows us to show a sensible error message.

(Bitbake rev: 26913202f83fbbecdce95da59515af102bcde4a7)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2013-10-04 14:15:36 +01:00
parent a333693c7f
commit 22d5782ef5
1 changed files with 6 additions and 3 deletions

View File

@ -354,9 +354,12 @@ class BitBakeXMLRPCClient(BitBakeBaseServer):
s.close()
except:
return None
self.serverImpl = XMLRPCProxyServer(host, port)
self.connection = BitBakeXMLRPCServerConnection(self.serverImpl, (ip, 0), self.observer_only, featureset)
return self.connection.connect()
try:
self.serverImpl = XMLRPCProxyServer(host, port)
self.connection = BitBakeXMLRPCServerConnection(self.serverImpl, (ip, 0), self.observer_only, featureset)
return self.connection.connect()
except Exception as e:
bb.fatal("Could not connect to server at %s:%s (%s)" % (host, port, str(e)))
def endSession(self):
self.connection.removeClient()