faft: Show the RPC address in some socket errors.
Before, it could be unclear what connection was refused:
[Errno 111] Connection refused
Now, the port number suggests that it's a local servod:
[Errno 111] Connection refused: 'localhost:9999'
BUG=None
TEST=Run firmware_FAFTSetup with local servod not running
Change-Id: I840fc792142662ce0cd82def3d0b506ddc936dc7
Reviewed-on: https://chromium-review.googlesource.com/1682167
Tested-by: Dana Goyette <[email protected]>
Commit-Ready: Dana Goyette <[email protected]>
Legacy-Commit-Queue: Commit Bot <[email protected]>
Reviewed-by: Greg Edelston <[email protected]>
diff --git a/server/hosts/rpc_server_tracker.py b/server/hosts/rpc_server_tracker.py
index 5dbb719..feb7890 100644
--- a/server/hosts/rpc_server_tracker.py
+++ b/server/hosts/rpc_server_tracker.py
@@ -189,13 +189,20 @@
delay_sec=min(max(timeout_seconds / 20.0, 0.1), 1))
def ready_test():
""" Call proxy.ready_test_name(). """
- getattr(proxy, ready_test_name)()
+ try:
+ getattr(proxy, ready_test_name)()
+ except socket.error as e:
+ e.filename = rpc_url.replace('http://', '')
+ raise
successful = False
try:
logging.info('Waiting %d seconds for XMLRPC server '
'to start.', timeout_seconds)
ready_test()
successful = True
+ except socket.error as e:
+ e.filename = rpc_url.replace('http://', '')
+ raise
finally:
if not successful:
logging.error('Failed to start XMLRPC server.')