Handle invalid build UUID in finger gateway

The RPC call will return an empty dict if the build UUID
cannot be found. We should handle that gracefully.

Change-Id: Ie0fa49e08d9213bf7226c6301896507866c36e28
This commit is contained in:
David Shrewsbury 2018-01-03 11:39:52 -05:00
parent 420e8a460b
commit 1c7d1e1ba1
1 changed files with 6 additions and 0 deletions

View File

@ -66,6 +66,12 @@ class RequestHandler(streamer_utils.BaseFingerRequestHandler):
try:
build_uuid = self.getCommand()
port_location = self.rpc.get_job_log_stream_address(build_uuid)
if not port_location:
msg = 'Invalid build UUID %s' % build_uuid
self.request.sendall(msg.encode('utf-8'))
return
self._fingerClient(
port_location['server'],
port_location['port'],