Strip \r from build UUID in fingergw
Without stripping this, we won't be able to match UUIDs. Change-Id: I06b98b7f883433313304bfc3bb21edd5725b94e6
This commit is contained in:
parent
1c7d1e1ba1
commit
79a66ddab8
|
@ -82,7 +82,7 @@ class TestStreaming(tests.base.AnsibleZuulTestCase):
|
|||
s = socket.create_connection((self.host, port))
|
||||
self.addCleanup(s.close)
|
||||
|
||||
req = '%s\n' % build_uuid
|
||||
req = '%s\r\n' % build_uuid
|
||||
s.sendall(req.encode('utf-8'))
|
||||
self.test_streaming_event.set()
|
||||
|
||||
|
@ -196,7 +196,7 @@ class TestStreaming(tests.base.AnsibleZuulTestCase):
|
|||
time.sleep(0.1)
|
||||
|
||||
with socket.create_connection(gateway_address) as s:
|
||||
msg = "%s\n" % build_uuid
|
||||
msg = "%s\r\n" % build_uuid
|
||||
s.sendall(msg.encode('utf-8'))
|
||||
event.set() # notify we are connected and req sent
|
||||
while True:
|
||||
|
|
|
@ -56,8 +56,6 @@ class RequestHandler(streamer_utils.BaseFingerRequestHandler):
|
|||
self.request.sendall(msg.encode("utf-8"))
|
||||
return
|
||||
|
||||
build_uuid = build_uuid.rstrip()
|
||||
|
||||
# validate build ID
|
||||
if not re.match("[0-9A-Fa-f]+$", build_uuid):
|
||||
msg = 'Build ID %s is not valid' % build_uuid
|
||||
|
|
|
@ -60,7 +60,8 @@ class BaseFingerRequestHandler(socketserver.BaseRequestHandler):
|
|||
ret = buffer.decode('utf-8')
|
||||
x = ret.find('\n')
|
||||
if x > 0:
|
||||
return ret[:x]
|
||||
# rstrip to remove any other unnecessary chars (e.g. \r)
|
||||
return ret[:x].rstrip()
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Reference in New Issue