Merge "misc py3 changes" into feature/zuulv3

This commit is contained in:
Jenkins 2017-05-19 19:54:34 +00:00 committed by Gerrit Code Review
commit 6d4455e7e6
3 changed files with 5 additions and 5 deletions

View File

@ -438,7 +438,7 @@ class ExecutorClient(object):
job.connection.sendAdminRequest(req, timeout=300)
self.log.debug("Response to cancel build %s request: %s" %
(build, req.response.strip()))
if req.response.startswith("OK"):
if req.response.startswith(b"OK"):
try:
del self.builds[job.unique]
except:

View File

@ -1531,11 +1531,11 @@ class QueueItem(object):
except KeyError as e:
self.log.error("Error while formatting url for job %s: unknown "
"key %s in pattern %s"
% (job, e.message, url_pattern))
% (job, e.args[0], url_pattern))
except AttributeError as e:
self.log.error("Error while formatting url for job %s: unknown "
"attribute %s in pattern %s"
% (job, e.message, url_pattern))
% (job, e.args[0], url_pattern))
except Exception:
self.log.exception("Error while formatting url for job %s with "
"pattern %s:" % (job, url_pattern))

View File

@ -128,7 +128,7 @@ class WebApp(threading.Thread):
def app(self, request):
# Try registered paths without a tenant_name first
path = request.path
for path_re, handler in self.routes.itervalues():
for path_re, handler in self.routes.values():
if path_re.match(path):
return handler(path, '', request)
@ -138,7 +138,7 @@ class WebApp(threading.Thread):
# Handle keys
if path.startswith('/keys'):
return self._handle_keys(request, path)
for path_re, handler in self.routes.itervalues():
for path_re, handler in self.routes.values():
if path_re.match(path):
return handler(path, tenant_name, request)
else: