Fix TypeError with Python 3.5

Python 3.5 libraries expect HTTP headers to be of string
type, not bytes.  Python 2.7 doesn't care.  This patch
changes the type of a headers from bytes to string.

Change-Id: I22a57d6a7b390ada712fed3b40f00510229c253d
Closes-bug: #1675553
This commit is contained in:
Dave McCowan 2017-03-23 16:55:12 -04:00
parent e88d79cae0
commit 672d57917c
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@ class BaseContextMiddleware(mw.Middleware):
def process_request(self, req):
request_id = req.headers.get('x-openstack-request-id')
if not request_id:
request_id = b'req-' + utils.generate_uuid().encode('ascii')
request_id = 'req-' + utils.generate_uuid()
setattr(req, 'request_id', request_id)
def process_response(self, resp):