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
diff --git a/zuul/lib/fingergw.py b/zuul/lib/fingergw.py
index c89ed0f..746f552 100644
--- a/zuul/lib/fingergw.py
+++ b/zuul/lib/fingergw.py
@@ -66,6 +66,12 @@
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'],