summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2019-01-22 15:35:44 -0800
committerJames E. Blair <jeblair@redhat.com>2019-01-22 15:35:44 -0800
commit3dc386626bc36a5314922702721bf72baf9e12d5 (patch)
tree70aa9f0f1b89328b836f93e93b582bd26193d179
parented7f9da75eae24506996cf82487f1343304f9b84 (diff)
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
Notes
Notes (review): Code-Review+2: Paul Belanger <pabelanger@redhat.com> Code-Review+2: Monty Taylor <mordred@inaugust.com> Workflow+1: Monty Taylor <mordred@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 23 Jan 2019 03:08:54 +0000 Reviewed-on: https://review.openstack.org/632582 Project: openstack-infra/zuul Branch: refs/heads/master
-rw-r--r--zuul/lib/fingergw.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/zuul/lib/fingergw.py b/zuul/lib/fingergw.py
index 38cc5ec..5f46418 100644
--- a/zuul/lib/fingergw.py
+++ b/zuul/lib/fingergw.py
@@ -64,6 +64,8 @@ class RequestHandler(streamer_utils.BaseFingerRequestHandler):
64 This method is called by the socketserver framework to handle an 64 This method is called by the socketserver framework to handle an
65 incoming request. 65 incoming request.
66 ''' 66 '''
67 server = None
68 port = None
67 try: 69 try:
68 build_uuid = self.getCommand() 70 build_uuid = self.getCommand()
69 port_location = self.rpc.get_job_log_stream_address(build_uuid) 71 port_location = self.rpc.get_job_log_stream_address(build_uuid)
@@ -73,17 +75,15 @@ class RequestHandler(streamer_utils.BaseFingerRequestHandler):
73 self.request.sendall(msg.encode('utf-8')) 75 self.request.sendall(msg.encode('utf-8'))
74 return 76 return
75 77
76 self._fingerClient( 78 server = port_location['server']
77 port_location['server'], 79 port = port_location['port']
78 port_location['port'], 80 self._fingerClient(server, port, build_uuid)
79 build_uuid,
80 )
81 except BrokenPipeError: # Client disconnect 81 except BrokenPipeError: # Client disconnect
82 return 82 return
83 except Exception: 83 except Exception:
84 self.log.exception( 84 self.log.exception(
85 'Finger request handling exception (%s:%s):', 85 'Finger request handling exception (%s:%s):',
86 port_location['server'], port_location['port']) 86 server, port)
87 msg = 'Internal streaming error' 87 msg = 'Internal streaming error'
88 self.request.sendall(msg.encode('utf-8')) 88 self.request.sendall(msg.encode('utf-8'))
89 return 89 return