diff options
author | David Shrewsbury <shrewsbury.dave@gmail.com> | 2018-01-03 11:39:52 -0500 |
---|---|---|
committer | David Shrewsbury <shrewsbury.dave@gmail.com> | 2018-01-03 11:39:52 -0500 |
commit | 1c7d1e1ba1d2f67dfd759a762fa2947e0f98cf32 (patch) | |
tree | cbdd9f533d4a0a0eda6e36f82b108eeca89bab5a | |
parent | 420e8a460bda83e14b6063bc17f8649597b22d46 (diff) | |
download | zuul-1c7d1e1ba1d2f67dfd759a762fa2947e0f98cf32.tar.gz |
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
-rw-r--r-- | zuul/lib/fingergw.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/zuul/lib/fingergw.py b/zuul/lib/fingergw.py index c89ed0f4a..746f5522a 100644 --- a/zuul/lib/fingergw.py +++ b/zuul/lib/fingergw.py @@ -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'], |