Code review comment for lp:~rackspace-titan/glance/wsgi-refactor

Revision history for this message
Jay Pipes (jaypipes) wrote :

Hey Brian,

The reason that test is failing is because of this change:

148 - image_id = image_meta['id']
149 - content_type = req.headers.get('content-type', 'notset')
150 - if content_type != 'application/octet-stream':
151 - self._safe_kill(req, image_id)
152 - msg = ("Content-Type must be application/octet-stream")
153 + try:
154 + req.get_content_type('application/octet-stream')
155 + except exception.InvalidContentType:
156 + msg = "Content-Type must be application/octet-stream"

The issue is that the image is registered and set to a 'queued' status before this code is run. The call to _safe_kill() is what (correctly) sets the image status to 'killed' and returns the error message. You need to add the call to _safe_kill() back to the new except InvalidContentType block.

Hope that helps,

jay

« Back to merge proposal