From 3dc386626bc36a5314922702721bf72baf9e12d5 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 22 Jan 2019 15:35:44 -0800 Subject: [PATCH] Fix secondary exception in fingergw A recent change addded more information to the fingergw exception handler. In some cases those variables can be undefined. Ensure we use initialized variables in the exception handler. Change-Id: I3636f4d208a1c35245581129c5690dc70e39336a --- zuul/lib/fingergw.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zuul/lib/fingergw.py b/zuul/lib/fingergw.py index 38cc5ec64b..5f46418367 100644 --- a/zuul/lib/fingergw.py +++ b/zuul/lib/fingergw.py @@ -64,6 +64,8 @@ class RequestHandler(streamer_utils.BaseFingerRequestHandler): This method is called by the socketserver framework to handle an incoming request. ''' + server = None + port = None try: build_uuid = self.getCommand() port_location = self.rpc.get_job_log_stream_address(build_uuid) @@ -73,17 +75,15 @@ class RequestHandler(streamer_utils.BaseFingerRequestHandler): self.request.sendall(msg.encode('utf-8')) return - self._fingerClient( - port_location['server'], - port_location['port'], - build_uuid, - ) + server = port_location['server'] + port = port_location['port'] + self._fingerClient(server, port, build_uuid) except BrokenPipeError: # Client disconnect return except Exception: self.log.exception( 'Finger request handling exception (%s:%s):', - port_location['server'], port_location['port']) + server, port) msg = 'Internal streaming error' self.request.sendall(msg.encode('utf-8')) return