)]}'
{"glance/registry/db/api.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"22890434bc67c07f7886d13a044e7e7b3939c62b","unresolved":false,"context_lines":[{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    def _required_format_absent(format, formats):"},{"line_number":317,"context_line":"        activating \u003d status \u003d\u003d \u0027active\u0027"},{"line_number":318,"context_line":"        recognized \u003d format in formats"},{"line_number":319,"context_line":"        return ((activating and (not format or not recognized))"},{"line_number":320,"context_line":"                or (not activating and format and not recognized))"},{"line_number":321,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAEn%2F%2F4os%3D","line":318,"updated":"2012-02-20 22:46:35.000000000","message":"OK, so this logic statement is, well, a bit hard to read... so I would advise a quick comment like this:\n\n # We don\u0027t mind having format \u003d None when we\u0027re just registering\n # an image, but if the image is being activated, make sure that the\n # format is valid.","commit_id":"a230cf5ae804751105c163f5e3cd02d6c6052cf8"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"44370fd787fa9519b54cf559084a70c7296d9633","unresolved":false,"context_lines":[{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    def _required_format_absent(format, formats):"},{"line_number":317,"context_line":"        activating \u003d status \u003d\u003d \u0027active\u0027"},{"line_number":318,"context_line":"        recognized \u003d format in formats"},{"line_number":319,"context_line":"        return ((activating and (not format or not recognized))"},{"line_number":320,"context_line":"                or (not activating and format and not recognized))"},{"line_number":321,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAEn%2F%2F4oc%3D","line":318,"in_reply_to":"AAAAEn%2F%2F4os%3D","updated":"2012-02-20 23:00:58.000000000","message":"Done.","commit_id":"a230cf5ae804751105c163f5e3cd02d6c6052cf8"}],"glance/tests/functional/test_api.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"22890434bc67c07f7886d13a044e7e7b3939c62b","unresolved":false,"context_lines":[{"line_number":631,"context_line":"        response, content \u003d http.request(path, \u0027POST\u0027,"},{"line_number":632,"context_line":"                            body\u003dtest_data_file.name)"},{"line_number":633,"context_line":"        self.assertEqual(response.status, 400)"},{"line_number":634,"context_line":"        expected \u003d \"Content-Type must be application/octet-stream\""},{"line_number":635,"context_line":"        self.assertTrue(expected in content,"},{"line_number":636,"context_line":"                        \"Could not find \u0027%s\u0027 in \u0027%s\u0027\" % (expected, content))"},{"line_number":637,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAEn%2F%2F4oo%3D","line":634,"updated":"2012-02-20 22:46:35.000000000","message":"Hmm, this seems like an odd change... Is that what we\u0027re really expecting?","commit_id":"a230cf5ae804751105c163f5e3cd02d6c6052cf8"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"44370fd787fa9519b54cf559084a70c7296d9633","unresolved":false,"context_lines":[{"line_number":631,"context_line":"        response, content \u003d http.request(path, \u0027POST\u0027,"},{"line_number":632,"context_line":"                            body\u003dtest_data_file.name)"},{"line_number":633,"context_line":"        self.assertEqual(response.status, 400)"},{"line_number":634,"context_line":"        expected \u003d \"Content-Type must be application/octet-stream\""},{"line_number":635,"context_line":"        self.assertTrue(expected in content,"},{"line_number":636,"context_line":"                        \"Could not find \u0027%s\u0027 in \u0027%s\u0027\" % (expected, content))"},{"line_number":637,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAEn%2F%2F4oQ%3D","line":634,"in_reply_to":"AAAAEn%2F%2F4oo%3D","updated":"2012-02-20 23:00:58.000000000","message":"Yes, I think the original test logic was slightly broken, as the image creation failed *before* the check was made on the Content-Type being set to octet-sequence.\n\nIt previously failed fast with 400 Bad Request on the absence of disk/container_format, whereas now it falls thru\u0027 to the upload logic:\n\n    def _upload(self, req, image_meta):\n        ...\n        try:\n            req.get_content_type(\u0027application/octet-stream\u0027)\n        except exception.InvalidContentType:\n            self._safe_kill(req, image_meta[\u0027id\u0027])\n            msg \u003d _(\"Content-Type must be application/octet-stream\")\n            logger.error(msg)\n            raise HTTPBadRequest(explanation\u003dmsg)","commit_id":"a230cf5ae804751105c163f5e3cd02d6c6052cf8"}]}
