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.
Hey Brian,
The reason that test is failing is because of this change:
148 - image_id = image_meta['id'] get('content- type', 'notset') octet-stream' : kill(req, image_id) octet-stream" ) content_ type('applicati on/octet- stream' ) InvalidContentT ype: octet-stream"
149 - content_type = req.headers.
150 - if content_type != 'application/
151 - self._safe_
152 - msg = ("Content-Type must be application/
153 + try:
154 + req.get_
155 + except exception.
156 + msg = "Content-Type must be application/
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