)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"fc29e10f4636dddcdcc5319f1444747fd4cbe105","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zhangyanzi \u003czhangyanzi@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-11-21 18:10:14 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"add/remove TenantAccess throws 500 Internal Error"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The function addTenantAccess and removeTenantAccess don\u0027t check whecher"},{"line_number":10,"context_line":"the parameter \"tenant\" is in request body. So the 500 error has been"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F%2BtEg%3D","line":7,"updated":"2013-11-21 10:27:15.000000000","message":"we should clearly indicate fix the bug on v2 api.","commit_id":"a9a5a29025f368e6ed101b9f51899be63435ab0a"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"fc29e10f4636dddcdcc5319f1444747fd4cbe105","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"add/remove TenantAccess throws 500 Internal Error"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The function addTenantAccess and removeTenantAccess don\u0027t check whecher"},{"line_number":10,"context_line":"the parameter \"tenant\" is in request body. So the 500 error has been"},{"line_number":11,"context_line":"thrown. Modify the code, to throw 400(HttpBadRequest)."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F%2BtE0%3D","line":9,"updated":"2013-11-21 10:27:15.000000000","message":"s/whecher/whether","commit_id":"a9a5a29025f368e6ed101b9f51899be63435ab0a"}],"nova/api/openstack/compute/contrib/flavor_access.py":[{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"0160d371b9276eb53513b3cb5faeddb316053605","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        authorize(context, action\u003d\"addTenantAccess\")"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        self._check_body(body)"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":177,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":178,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BpB0%3D","line":175,"updated":"2013-11-22 04:39:06.000000000","message":"I think you can drop the _check_body and use self.is_valid_body instead. eg\n\nif not self.is_valid_body(body, \u0027addTenantAccess\u0027)\n    raise webob.exc.HTTPBadRequest(blah)\n\nWill still need the KeyError check for tenant, but then you can give a specific error message about which element is missing for that case rather than a generic 400.","commit_id":"a9a5a29025f368e6ed101b9f51899be63435ab0a"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0c0c8b5949a3365a44e453af3a5bcfa0d871b940","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        authorize(context, action\u003d\"addTenantAccess\")"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        self._check_body(body)"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":177,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":178,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BohI%3D","line":175,"in_reply_to":"AAAATn%2F%2BouM%3D","updated":"2013-11-22 08:06:11.000000000","message":"There is case for the request body is {\u0027addTenantAccess\u0027: None}. \u0027is_valid_body\u0027 can check that case.","commit_id":"a9a5a29025f368e6ed101b9f51899be63435ab0a"},{"author":{"_account_id":8286,"name":"zhangyanzi","email":"yanzi.zhang@samsung.com","username":"zhangyanzi"},"change_message_id":"b7d2efed71cee20afbe2b7060ca0e732e8924ce9","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        authorize(context, action\u003d\"addTenantAccess\")"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        self._check_body(body)"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":177,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":178,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BouM%3D","line":175,"in_reply_to":"AAAATn%2F%2BpB0%3D","updated":"2013-11-22 07:14:26.000000000","message":"Hi Christopher:\nThanks for your review:)\nI think the body validation (self.is_valid_body) is redundant. The fact that this extension is registered as WSGI action implies that the body must contain a key with the same name as action.\nI think I can direct drop the _check_body.","commit_id":"a9a5a29025f368e6ed101b9f51899be63435ab0a"},{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"fc29e10f4636dddcdcc5319f1444747fd4cbe105","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        self._check_body(body)"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":177,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":178,"context_line":"        except KeyError:"},{"line_number":179,"context_line":"            raise webob.exc.HTTPBadRequest()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BtCk%3D","line":176,"updated":"2013-11-21 10:27:15.000000000","message":"The patch https://review.openstack.org/#/c/25358/45 is a final way to deal with this sort of bug.","commit_id":"a9a5a29025f368e6ed101b9f51899be63435ab0a"},{"author":{"_account_id":8286,"name":"zhangyanzi","email":"yanzi.zhang@samsung.com","username":"zhangyanzi"},"change_message_id":"b7d2efed71cee20afbe2b7060ca0e732e8924ce9","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        self._check_body(body)"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":177,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":178,"context_line":"        except KeyError:"},{"line_number":179,"context_line":"            raise webob.exc.HTTPBadRequest()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BosI%3D","line":176,"in_reply_to":"AAAATn%2F%2BpCE%3D","updated":"2013-11-22 07:14:26.000000000","message":"Thanks!","commit_id":"a9a5a29025f368e6ed101b9f51899be63435ab0a"},{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"0160d371b9276eb53513b3cb5faeddb316053605","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        self._check_body(body)"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":177,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":178,"context_line":"        except KeyError:"},{"line_number":179,"context_line":"            raise webob.exc.HTTPBadRequest()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BpCE%3D","line":176,"in_reply_to":"AAAATn%2F%2Bs%2B8%3D","updated":"2013-11-22 04:39:06.000000000","message":"I\u0027m fine with these sorts of patches going in. Its likely that the api validation framework will only be used for V3 anyway.","commit_id":"a9a5a29025f368e6ed101b9f51899be63435ab0a"},{"author":{"_account_id":8286,"name":"zhangyanzi","email":"yanzi.zhang@samsung.com","username":"zhangyanzi"},"change_message_id":"42f48dbeb81a81966a19ff5bec73c5b58b9a914f","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        self._check_body(body)"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":177,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":178,"context_line":"        except KeyError:"},{"line_number":179,"context_line":"            raise webob.exc.HTTPBadRequest()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2Bs%2B8%3D","line":176,"in_reply_to":"AAAATn%2F%2BtCk%3D","updated":"2013-11-21 10:44:35.000000000","message":"Hi Guohui:\nDo you mean I should change this after that patch merged,\nand use the method that patch provided?","commit_id":"a9a5a29025f368e6ed101b9f51899be63435ab0a"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"6582deee8b133ea54a62fbb0d42bb3543652850a","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":172,"context_line":"        authorize(context, action\u003d\"addTenantAccess\")"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":177,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BbyQ%3D","line":174,"updated":"2013-11-26 05:33:34.000000000","message":"This will raise another 500 error if there is no addTenantAccess key in body. Is this checked for somewhere else?","commit_id":"cf964a99b50fdf5914c0ce0cdd444dde5f4f9e63"},{"author":{"_account_id":8286,"name":"zhangyanzi","email":"yanzi.zhang@samsung.com","username":"zhangyanzi"},"change_message_id":"12f92cb08b149bd8890821bdf427bba8b5e5c9b0","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":172,"context_line":"        authorize(context, action\u003d\"addTenantAccess\")"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":177,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BbiE%3D","line":174,"in_reply_to":"AAAATn%2F%2BbjE%3D","updated":"2013-11-26 06:50:01.000000000","message":"Hi Michael and Jay:\nThanks for your review.\n@wsgi.action(\"addTenantAccess\")\nThis extension is registered as WSGI action implies that the body must contain a key with the same name as action.\nSo,there will not raise 500 error.\nAnd i will change the code for V3 API.","commit_id":"cf964a99b50fdf5914c0ce0cdd444dde5f4f9e63"},{"author":{"_account_id":7494,"name":"Guangya Liu","email":"gyliu513@gmail.com","username":"JayLau"},"change_message_id":"74be8d3accd5474ce8762105da6acfaa4068421c","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":172,"context_line":"        authorize(context, action\u003d\"addTenantAccess\")"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"        vals \u003d body[\u0027addTenantAccess\u0027]"},{"line_number":175,"context_line":"        try:"},{"line_number":176,"context_line":"            tenant \u003d vals[\u0027tenant\u0027]"},{"line_number":177,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BbjE%3D","line":174,"in_reply_to":"AAAATn%2F%2BbyQ%3D","updated":"2013-11-26 06:41:10.000000000","message":"+1, this also need some validation.\n\nPlease take a look at https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L765\n\nAlso I checked V3 API, also have such issue, please fix them together. Thanks.","commit_id":"cf964a99b50fdf5914c0ce0cdd444dde5f4f9e63"}]}
