)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"86f0fc4d732ee05fa3cb6fe752924425cdb9fb91","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"DocImpact"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Closes-Bug: 1475647"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: Ieb510e5516128078d40d39fd9b4f339ce64e10e7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1a4dcd0f_31e38aa5","line":16,"updated":"2015-08-04 10:33:16.000000000","message":"Should this be Partial-bug? (It doesn\u0027t fix metadefs for example)","commit_id":"85f7dccbad5b4a6760dfc9d7226f0002154453b3"}],"glance/api/v2/router.py":[{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"b933b7e6933ffce039d5b590b258f6f7240d213b","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                       controller\u003dimage_actions_resource,"},{"line_number":460,"context_line":"                       action\u003d\u0027deactivate\u0027,"},{"line_number":461,"context_line":"                       conditions\u003d{\u0027method\u0027: [\u0027POST\u0027]},"},{"line_number":462,"context_line":"                       bodyallowed\u003dFalse)"},{"line_number":463,"context_line":"        mapper.connect(\u0027/images/{image_id}/actions/reactivate\u0027,"},{"line_number":464,"context_line":"                       controller\u003dimage_actions_resource,"},{"line_number":465,"context_line":"                       action\u003d\u0027reactivate\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_b6e498e0","line":462,"updated":"2015-07-30 02:02:00.000000000","message":"Do we need to be strict about not allowing body for POST requests ?","commit_id":"4c5f631e7d63054681f78462341deed4412e91d7"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"55809d60fd414f6b7d736ed59c5fd093c58930bc","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                       controller\u003dimage_actions_resource,"},{"line_number":460,"context_line":"                       action\u003d\u0027deactivate\u0027,"},{"line_number":461,"context_line":"                       conditions\u003d{\u0027method\u0027: [\u0027POST\u0027]},"},{"line_number":462,"context_line":"                       bodyallowed\u003dFalse)"},{"line_number":463,"context_line":"        mapper.connect(\u0027/images/{image_id}/actions/reactivate\u0027,"},{"line_number":464,"context_line":"                       controller\u003dimage_actions_resource,"},{"line_number":465,"context_line":"                       action\u003d\u0027reactivate\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_52a3809e","line":462,"in_reply_to":"3a50d1a3_6ee391a5","updated":"2015-07-31 21:02:32.000000000","message":"Ah, okay, overlooked that.","commit_id":"4c5f631e7d63054681f78462341deed4412e91d7"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"fd8dde3131b7ffd1c6ad1bdbf5dedd9adf6d7ad1","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                       controller\u003dimage_actions_resource,"},{"line_number":460,"context_line":"                       action\u003d\u0027deactivate\u0027,"},{"line_number":461,"context_line":"                       conditions\u003d{\u0027method\u0027: [\u0027POST\u0027]},"},{"line_number":462,"context_line":"                       bodyallowed\u003dFalse)"},{"line_number":463,"context_line":"        mapper.connect(\u0027/images/{image_id}/actions/reactivate\u0027,"},{"line_number":464,"context_line":"                       controller\u003dimage_actions_resource,"},{"line_number":465,"context_line":"                       action\u003d\u0027reactivate\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_6ee391a5","line":462,"in_reply_to":"3a50d1a3_b6e498e0","updated":"2015-07-30 08:43:17.000000000","message":"If you post a body to this method, a 500 is created. Therefore this is why this exists. This one was more to catch the error that occurs, since the API does not allow bodies to this post request.","commit_id":"4c5f631e7d63054681f78462341deed4412e91d7"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"d8e6797585b8139263395bc78f05512354b55571","unresolved":false,"context_lines":[{"line_number":505,"context_line":""},{"line_number":506,"context_line":"        mapper.connect(\u0027/tasks/{task_id}\u0027,"},{"line_number":507,"context_line":"                       controller\u003dtasks_resource,"},{"line_number":508,"context_line":"                       action\u003d\u0027get\u0027,"},{"line_number":509,"context_line":"                       conditions\u003d{\u0027method\u0027: [\u0027GET\u0027]})"},{"line_number":510,"context_line":"        mapper.connect(\u0027/tasks/{task_id}\u0027,"},{"line_number":511,"context_line":"                       controller\u003dtasks_resource,"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a710552_5ce3b633","line":508,"updated":"2015-12-16 01:04:42.000000000","message":"I\u0027m wondering how above changes are figured out, since if a body is passed in against GET a task, user will get a 500 as well.","commit_id":"1acd8e69fef9ed71bda5893e01db3eb8352a7182"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"a5c2234c4f4eca60fcc9ba7f2b5716b0095eaf20","unresolved":false,"context_lines":[{"line_number":505,"context_line":""},{"line_number":506,"context_line":"        mapper.connect(\u0027/tasks/{task_id}\u0027,"},{"line_number":507,"context_line":"                       controller\u003dtasks_resource,"},{"line_number":508,"context_line":"                       action\u003d\u0027get\u0027,"},{"line_number":509,"context_line":"                       conditions\u003d{\u0027method\u0027: [\u0027GET\u0027]})"},{"line_number":510,"context_line":"        mapper.connect(\u0027/tasks/{task_id}\u0027,"},{"line_number":511,"context_line":"                       controller\u003dtasks_resource,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a7e1126_fafe0037","line":508,"in_reply_to":"3a7e1126_2b49e75f","updated":"2015-12-18 11:11:38.000000000","message":"I\u0027m OK with that. But would you mind update the commit message to clarify that? Thanks.","commit_id":"1acd8e69fef9ed71bda5893e01db3eb8352a7182"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"78dbb198bb90b3c2ac9c749212f616a4d25be171","unresolved":false,"context_lines":[{"line_number":505,"context_line":""},{"line_number":506,"context_line":"        mapper.connect(\u0027/tasks/{task_id}\u0027,"},{"line_number":507,"context_line":"                       controller\u003dtasks_resource,"},{"line_number":508,"context_line":"                       action\u003d\u0027get\u0027,"},{"line_number":509,"context_line":"                       conditions\u003d{\u0027method\u0027: [\u0027GET\u0027]})"},{"line_number":510,"context_line":"        mapper.connect(\u0027/tasks/{task_id}\u0027,"},{"line_number":511,"context_line":"                       controller\u003dtasks_resource,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a7e1126_1892864c","line":508,"in_reply_to":"3a7e1126_fafe0037","updated":"2015-12-22 03:27:42.000000000","message":"Fei Long, what exactly would you like to see in the commit message? I\u0027m a bit confused :D\n\nAlso, I\u0027d say you can feel free to help updating commit messages if that\u0027s the only thing that\u0027ll block the patch and no other PS is needed code wise.","commit_id":"1acd8e69fef9ed71bda5893e01db3eb8352a7182"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"8eed53e0a6a14e9f40b6abaef59ddd4382cc6595","unresolved":false,"context_lines":[{"line_number":505,"context_line":""},{"line_number":506,"context_line":"        mapper.connect(\u0027/tasks/{task_id}\u0027,"},{"line_number":507,"context_line":"                       controller\u003dtasks_resource,"},{"line_number":508,"context_line":"                       action\u003d\u0027get\u0027,"},{"line_number":509,"context_line":"                       conditions\u003d{\u0027method\u0027: [\u0027GET\u0027]})"},{"line_number":510,"context_line":"        mapper.connect(\u0027/tasks/{task_id}\u0027,"},{"line_number":511,"context_line":"                       controller\u003dtasks_resource,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a7e1126_2b49e75f","line":508,"in_reply_to":"5a710552_5ce3b633","updated":"2015-12-17 11:20:18.000000000","message":"I decided to only cover the main ones on this first patch, to keep it concise, instead of just rolling it out everwhere at the beginning. As not having the body_reject does not change the current behaviour this does not matter.","commit_id":"1acd8e69fef9ed71bda5893e01db3eb8352a7182"}],"glance/common/wsgi.py":[{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"b933b7e6933ffce039d5b590b258f6f7240d213b","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        \"\"\"WSGI method that controls (de)serialization and method dispatch.\"\"\""},{"line_number":873,"context_line":"        action_args \u003d self.get_action_args(request.environ)"},{"line_number":874,"context_line":"        action \u003d action_args.pop(\u0027action\u0027, None)"},{"line_number":875,"context_line":"        bodyallowed \u003d action_args.pop(\u0027bodyallowed\u0027, None)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if(bodyallowed !\u003d None):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_2b56e52a","line":875,"updated":"2015-07-30 02:02:00.000000000","message":"If bodyallowed\u003dTrue and the user has not specified a body, the deserializer will return an empty dict, which I feel is valid and hence we don\u0027t have to throw an error in L882.\n\nThus, the default could be True to simplify the case.","commit_id":"4c5f631e7d63054681f78462341deed4412e91d7"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"b933b7e6933ffce039d5b590b258f6f7240d213b","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        bodyallowed \u003d action_args.pop(\u0027bodyallowed\u0027, None)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if(bodyallowed !\u003d None):"},{"line_number":879,"context_line":"                bodyallowed \u003d bodyallowed \u003d\u003d \u0027True\u0027"},{"line_number":880,"context_line":"                if(bodyallowed !\u003d self.dispatch(self.deserializer,"},{"line_number":881,"context_line":"                                                \u0027has_body\u0027, request)):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_8b2059b2","line":878,"updated":"2015-07-30 02:02:00.000000000","message":"Citing ^, this could be refactored a bit, IMO.\n\n has_body \u003d self.deserializer.has_body(request)\n if not bodyallowed and has_body:\n     msg \u003d _(\u0027Body not allowed for this request\u0027)\n     raise webob.exc.HTTPBadRequest(explanation\u003dmsg)","commit_id":"4c5f631e7d63054681f78462341deed4412e91d7"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"55809d60fd414f6b7d736ed59c5fd093c58930bc","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        bodyallowed \u003d action_args.pop(\u0027bodyallowed\u0027, None)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if(bodyallowed !\u003d None):"},{"line_number":879,"context_line":"                bodyallowed \u003d bodyallowed \u003d\u003d \u0027True\u0027"},{"line_number":880,"context_line":"                if(bodyallowed !\u003d self.dispatch(self.deserializer,"},{"line_number":881,"context_line":"                                                \u0027has_body\u0027, request)):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_672120fc","line":878,"in_reply_to":"3a50d1a3_3135e8a7","updated":"2015-07-31 21:02:32.000000000","message":"AFAIK, all v2 controller methods that require a body does a validation. So I am not too sure if there is an use-case yet :). \n\nDo you think there is a controller method that could benefit ?","commit_id":"4c5f631e7d63054681f78462341deed4412e91d7"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"fd8dde3131b7ffd1c6ad1bdbf5dedd9adf6d7ad1","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        bodyallowed \u003d action_args.pop(\u0027bodyallowed\u0027, None)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if(bodyallowed !\u003d None):"},{"line_number":879,"context_line":"                bodyallowed \u003d bodyallowed \u003d\u003d \u0027True\u0027"},{"line_number":880,"context_line":"                if(bodyallowed !\u003d self.dispatch(self.deserializer,"},{"line_number":881,"context_line":"                                                \u0027has_body\u0027, request)):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_3135e8a7","line":878,"in_reply_to":"3a50d1a3_8b2059b2","updated":"2015-07-30 08:43:17.000000000","message":"The reason I did it like this is that the user then could force a method to have a body if setting it to true. Else this part is skipped as that part of the api does not implement it and a value is not chosen.","commit_id":"4c5f631e7d63054681f78462341deed4412e91d7"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"86f0fc4d732ee05fa3cb6fe752924425cdb9fb91","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        \"\"\"WSGI method that controls (de)serialization and method dispatch.\"\"\""},{"line_number":873,"context_line":"        action_args \u003d self.get_action_args(request.environ)"},{"line_number":874,"context_line":"        action \u003d action_args.pop(\u0027action\u0027, None)"},{"line_number":875,"context_line":"        bodystrict \u003d action_args.pop(\u0027bodystrict\u0027, None)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if(bodystrict !\u003d None):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_f4ee7021","line":875,"updated":"2015-08-04 10:33:16.000000000","message":"You could look at casting the parameter to a bool at this point, eg:\n\nbodystrict \u003d cast_function(action_args.pop(\u0027bodystrict\u0027, False))\n\nglance may already have a function that does this, or there may be one in oslo.","commit_id":"85f7dccbad5b4a6760dfc9d7226f0002154453b3"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"86f0fc4d732ee05fa3cb6fe752924425cdb9fb91","unresolved":false,"context_lines":[{"line_number":874,"context_line":"        action \u003d action_args.pop(\u0027action\u0027, None)"},{"line_number":875,"context_line":"        bodystrict \u003d action_args.pop(\u0027bodystrict\u0027, None)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if(bodystrict !\u003d None):"},{"line_number":879,"context_line":"                bodystrict \u003d bodystrict \u003d\u003d \u0027True\u0027"},{"line_number":880,"context_line":"                if(bodystrict !\u003d self.dispatch(self.deserializer,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_b42b0830","line":877,"updated":"2015-08-04 10:33:16.000000000","message":"An if statement with brackets like this:\n\nif(bodystrict !\u003d None)\n\nwon\u0027t pass review.","commit_id":"85f7dccbad5b4a6760dfc9d7226f0002154453b3"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"86f0fc4d732ee05fa3cb6fe752924425cdb9fb91","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        bodystrict \u003d action_args.pop(\u0027bodystrict\u0027, None)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if(bodystrict !\u003d None):"},{"line_number":879,"context_line":"                bodystrict \u003d bodystrict \u003d\u003d \u0027True\u0027"},{"line_number":880,"context_line":"                if(bodystrict !\u003d self.dispatch(self.deserializer,"},{"line_number":881,"context_line":"                                                \u0027has_body\u0027, request)):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_d4825452","line":878,"updated":"2015-08-04 10:33:16.000000000","message":"The three way logic here is out of scope of the bug and makes reviewing the patch more complex than it needs to be. (It also introduces a logic that is not actually consumed, or tested.)\n\nTo fix the bug you just need the simpler True/False logic.\n\nI\u0027d suggest a parameter called something like \u0027body_reject\u0027 which can be either True or False.\nIf it is True then the presence of a body returns a 400.","commit_id":"85f7dccbad5b4a6760dfc9d7226f0002154453b3"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"86f0fc4d732ee05fa3cb6fe752924425cdb9fb91","unresolved":false,"context_lines":[{"line_number":878,"context_line":"            if(bodystrict !\u003d None):"},{"line_number":879,"context_line":"                bodystrict \u003d bodystrict \u003d\u003d \u0027True\u0027"},{"line_number":880,"context_line":"                if(bodystrict !\u003d self.dispatch(self.deserializer,"},{"line_number":881,"context_line":"                                                \u0027has_body\u0027, request)):"},{"line_number":882,"context_line":"                    msg \u003d _(\u0027Body should be %s\u0027) % bodystrict"},{"line_number":883,"context_line":"                    raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":884,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_b4b548ce","line":881,"updated":"2015-08-04 10:33:16.000000000","message":"I would use the simpler\n\n if request.is_body_readable or request.content-length \u003e 0:\n\nas the condition to raise a 400.\n\nSo:\n\nif body_reject is True and request.is_body_readable or request.content-length \u003e 0:\n    msg \u003d _(\u0027Body should be %s\u0027) % bodystrict\n    raise webob.exc.HTTPBadRequest(explanation\u003dmsg)","commit_id":"85f7dccbad5b4a6760dfc9d7226f0002154453b3"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"bdd312f073f28b0ab54153117bf6098a1881fbe3","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        \"\"\"WSGI method that controls (de)serialization and method dispatch.\"\"\""},{"line_number":873,"context_line":"        action_args \u003d self.get_action_args(request.environ)"},{"line_number":874,"context_line":"        action \u003d action_args.pop(\u0027action\u0027, None)"},{"line_number":875,"context_line":"        body_reject \u003d action_args.pop(\u0027bodyreject\u0027, False)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if body_reject \u003d\u003d \u0027True\u0027 and self.deserializer.has_body(request):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_35b7dbd9","line":875,"updated":"2015-08-04 16:42:02.000000000","message":"nit: as a style thing, it\u0027s probably better to pick one of body_reject or bodyreject.","commit_id":"c6429388ffed1dd6b5cb8811968c476a2eef715f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"0f943f794f3d53a586da12074d6c49df996ae841","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        body_reject \u003d action_args.pop(\u0027body_reject\u0027, False)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if body_reject \u003d\u003d \u0027True\u0027 and self.deserializer.has_body(request):"},{"line_number":879,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":880,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":881,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a4dcd0f_76b7403a","line":878,"updated":"2015-08-06 12:21:48.000000000","message":"body_reject is a bool so this condition will fail as body_reject \u003d\u003d \u0027True\u0027 will return False.\n\n\u003e\u003e\u003e True \u003d\u003d \u0027True\u0027\nFalse\n\njust use, if body_reject and self.deserializer.has_body(request) instead","commit_id":"2b33121c55c391c7c05b3b32f4c97cae1c851b8e"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"708e94624d819863cfa727e1ce7f905e448d0043","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        body_reject \u003d action_args.pop(\u0027body_reject\u0027, False)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if body_reject \u003d\u003d \u0027True\u0027 and self.deserializer.has_body(request):"},{"line_number":879,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":880,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":881,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a4dcd0f_6543c742","line":878,"in_reply_to":"1a4dcd0f_764c20c8","updated":"2015-08-13 14:09:53.000000000","message":"Good point, Niall, but you can see from this discussion that the string/bool mix is forcing people to read this a few times to make sure it\u0027s OK.  For the sake of future glance devs, please adopt Stuart\u0027s suggestion to cast it to a bool to make everything obvious.","commit_id":"2b33121c55c391c7c05b3b32f4c97cae1c851b8e"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"87fb106d1d5dfd42a3e56f3de5d6a1ca092f2bf0","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        body_reject \u003d action_args.pop(\u0027body_reject\u0027, False)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if body_reject \u003d\u003d \u0027True\u0027 and self.deserializer.has_body(request):"},{"line_number":879,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":880,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":881,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a4dcd0f_764c20c8","line":878,"in_reply_to":"1a4dcd0f_76b7403a","updated":"2015-08-06 12:36:59.000000000","message":"When body reject reads from action args it is in the form \u0027True\u0027 thats why I compare it against a string. I could have the false value as \u0027False\u0027 or False, it will still fail this test.","commit_id":"2b33121c55c391c7c05b3b32f4c97cae1c851b8e"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"216338cc10443e86d3294ada7a848e1430f8a7e3","unresolved":false,"context_lines":[{"line_number":875,"context_line":"        body_reject \u003d action_args.pop(\u0027body_reject\u0027, False)"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"        try:"},{"line_number":878,"context_line":"            if body_reject \u003d\u003d \u0027True\u0027 and self.deserializer.has_body(request):"},{"line_number":879,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":880,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":881,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a4dcd0f_568004c0","line":878,"in_reply_to":"1a4dcd0f_76b7403a","updated":"2015-08-06 12:36:22.000000000","message":"body_reject comes back from action_args.pop as a string. So we have a mix of bool and string. I\u0027d suggested in a previous comment casting what action_args.pop returns to a bool.","commit_id":"2b33121c55c391c7c05b3b32f4c97cae1c851b8e"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"5c82abb118609604061b7619bc84b1624764fc45","unresolved":false,"context_lines":[{"line_number":878,"context_line":"        action_args \u003d self.get_action_args(request.environ)"},{"line_number":879,"context_line":"        action \u003d action_args.pop(\u0027action\u0027, None)"},{"line_number":880,"context_line":"        # This makes body reject a boolean from a string."},{"line_number":881,"context_line":"        body_reject \u003d action_args.pop(\u0027body_reject\u0027, False) \u003d\u003d \u0027True\u0027"},{"line_number":882,"context_line":""},{"line_number":883,"context_line":"        try:"},{"line_number":884,"context_line":"            if body_reject and self.deserializer.has_body(request):"}],"source_content_type":"text/x-python","patch_set":10,"id":"fa80f949_c3f8024c","line":881,"updated":"2015-11-05 17:37:20.000000000","message":"This might be more clear if you do:\n\nbody_reject \u003d oslo_utils.strutils.bool_from_string(action_args.pop(\u0027body_reject\u0027, None))\n\nthen you don\u0027t even need the comment.","commit_id":"3115dff8573ba977ceb021bf5bc224b0d02b350f"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"31a904ef64a01b6da6cde2190688c8ceb64dc996","unresolved":false,"context_lines":[{"line_number":878,"context_line":"        action_args \u003d self.get_action_args(request.environ)"},{"line_number":879,"context_line":"        action \u003d action_args.pop(\u0027action\u0027, None)"},{"line_number":880,"context_line":"        # This makes body reject a boolean from a string."},{"line_number":881,"context_line":"        body_reject \u003d action_args.pop(\u0027body_reject\u0027, False) \u003d\u003d \u0027True\u0027"},{"line_number":882,"context_line":""},{"line_number":883,"context_line":"        try:"},{"line_number":884,"context_line":"            if body_reject and self.deserializer.has_body(request):"}],"source_content_type":"text/x-python","patch_set":10,"id":"da85f559_ff28d49b","line":881,"in_reply_to":"fa80f949_c3f8024c","updated":"2015-11-12 10:23:50.000000000","message":"Agree, it is better to use oslo_utils here.","commit_id":"3115dff8573ba977ceb021bf5bc224b0d02b350f"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"31a904ef64a01b6da6cde2190688c8ceb64dc996","unresolved":false,"context_lines":[{"line_number":883,"context_line":"        try:"},{"line_number":884,"context_line":"            if body_reject and self.deserializer.has_body(request):"},{"line_number":885,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":886,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":887,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"},{"line_number":888,"context_line":"                                                 action, request)"},{"line_number":889,"context_line":"            action_args.update(deserialized_request)"}],"source_content_type":"text/x-python","patch_set":10,"id":"da85f559_ff61b405","line":886,"updated":"2015-11-12 10:23:50.000000000","message":"Hmm, do I understand correctly that this exception will be catched in line 891 and leads to 500 error?","commit_id":"3115dff8573ba977ceb021bf5bc224b0d02b350f"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"c0ad2d0c82b01f23553f94ab3a0bc5d5327908b7","unresolved":false,"context_lines":[{"line_number":883,"context_line":"        try:"},{"line_number":884,"context_line":"            if body_reject and self.deserializer.has_body(request):"},{"line_number":885,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":886,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":887,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"},{"line_number":888,"context_line":"                                                 action, request)"},{"line_number":889,"context_line":"            action_args.update(deserialized_request)"}],"source_content_type":"text/x-python","patch_set":10,"id":"da85f559_948854c8","line":886,"in_reply_to":"da85f559_a2ae957e","updated":"2015-11-13 07:39:51.000000000","message":"Ok, thanks.","commit_id":"3115dff8573ba977ceb021bf5bc224b0d02b350f"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"20dbb692ee7bd76bab3b6883309143361a35a7d5","unresolved":false,"context_lines":[{"line_number":883,"context_line":"        try:"},{"line_number":884,"context_line":"            if body_reject and self.deserializer.has_body(request):"},{"line_number":885,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":886,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":887,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"},{"line_number":888,"context_line":"                                                 action, request)"},{"line_number":889,"context_line":"            action_args.update(deserialized_request)"}],"source_content_type":"text/x-python","patch_set":10,"id":"da85f559_a2ae957e","line":886,"in_reply_to":"da85f559_ff61b405","updated":"2015-11-12 17:23:23.000000000","message":"This gets caught by the webob.exc.WSGIHTTPException. As webob.exc.HTTPBadRequest is a subclass of that exception. So it gets re-raised as the BadRequest.","commit_id":"3115dff8573ba977ceb021bf5bc224b0d02b350f"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"0730917bc66e911c1cd205fa6c604b0a30c6435b","unresolved":false,"context_lines":[{"line_number":882,"context_line":"            action_args.pop(\u0027body_reject\u0027, None))"},{"line_number":883,"context_line":""},{"line_number":884,"context_line":"        try:"},{"line_number":885,"context_line":"            if body_reject and self.deserializer.has_body(request):"},{"line_number":886,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":887,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":888,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_aa16f8a4","line":885,"updated":"2015-12-07 00:19:27.000000000","message":"I\u0027m a bit torn here.  If body is not required, can\u0027t we just move on ignoring the body that has been sent instead of raising an error? What does the API-WG say about this?\n\nI understand it lets users assume that a body is accepted but I\u0027ve seen this behavior elsewhere with a clear documentatio nsaying that bodies will be ignored where bodies are not required.","commit_id":"1acd8e69fef9ed71bda5893e01db3eb8352a7182"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"7afa66615eb534949e99e0807f625d7c0f1bbf90","unresolved":false,"context_lines":[{"line_number":882,"context_line":"            action_args.pop(\u0027body_reject\u0027, None))"},{"line_number":883,"context_line":""},{"line_number":884,"context_line":"        try:"},{"line_number":885,"context_line":"            if body_reject and self.deserializer.has_body(request):"},{"line_number":886,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":887,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":888,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_ac5d867a","line":885,"updated":"2015-12-07 19:52:00.000000000","message":"Niall, thanks! That\u0027s good enough for me!","commit_id":"1acd8e69fef9ed71bda5893e01db3eb8352a7182"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"b65b20ac9dcf562b8d756d2ae6c8dfd3d8f43e96","unresolved":false,"context_lines":[{"line_number":882,"context_line":"            action_args.pop(\u0027body_reject\u0027, None))"},{"line_number":883,"context_line":""},{"line_number":884,"context_line":"        try:"},{"line_number":885,"context_line":"            if body_reject and self.deserializer.has_body(request):"},{"line_number":886,"context_line":"                msg \u003d _(\u0027A body is not expected with this request.\u0027)"},{"line_number":887,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":888,"context_line":"            deserialized_request \u003d self.dispatch(self.deserializer,"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a740942_6eba52c2","line":885,"in_reply_to":"7a740942_aa16f8a4","updated":"2015-12-07 11:05:33.000000000","message":"http://lists.openstack.org/pipermail/openstack-dev/2015-July/070319.html That is the start of the mailing list thread that was sent a while back. The outcome seemed to prefer a 400 rather than ignoring it.","commit_id":"1acd8e69fef9ed71bda5893e01db3eb8352a7182"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"532d3fbec868c83c749395ae7d651615035232cc","unresolved":false,"context_lines":[{"line_number":878,"context_line":"        \"\"\"WSGI method that controls (de)serialization and method dispatch.\"\"\""},{"line_number":879,"context_line":"        action_args \u003d self.get_action_args(request.environ)"},{"line_number":880,"context_line":"        action \u003d action_args.pop(\u0027action\u0027, None)"},{"line_number":881,"context_line":"        body_reject \u003d strutils.bool_from_string("},{"line_number":882,"context_line":"            action_args.pop(\u0027body_reject\u0027, None))"},{"line_number":883,"context_line":""},{"line_number":884,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a68dd71_23584efa","line":881,"updated":"2016-01-20 20:39:42.000000000","message":"Why do we need this if we\u0027re passing True?","commit_id":"9b430f99518e10ae263bedec3062408af332068c"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"3587cfeac5aa6070a1ecfb63e43aedb3fcd80ae3","unresolved":false,"context_lines":[{"line_number":878,"context_line":"        \"\"\"WSGI method that controls (de)serialization and method dispatch.\"\"\""},{"line_number":879,"context_line":"        action_args \u003d self.get_action_args(request.environ)"},{"line_number":880,"context_line":"        action \u003d action_args.pop(\u0027action\u0027, None)"},{"line_number":881,"context_line":"        body_reject \u003d strutils.bool_from_string("},{"line_number":882,"context_line":"            action_args.pop(\u0027body_reject\u0027, None))"},{"line_number":883,"context_line":""},{"line_number":884,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"9a68dd71_8f26ddcc","line":881,"in_reply_to":"9a68dd71_23584efa","updated":"2016-01-21 11:24:36.000000000","message":"action_args.pop(\u0027body_reject\u0027, None) returns type \u003ctype \u0027unicode\u0027\u003e.\n\nThis means that for this to work the user has to specify True in the router file.","commit_id":"9b430f99518e10ae263bedec3062408af332068c"}],"glance/tests/functional/v2/test_images.py":[{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"86f0fc4d732ee05fa3cb6fe752924425cdb9fb91","unresolved":false,"context_lines":[{"line_number":605,"context_line":""},{"line_number":606,"context_line":"        # GET /images/imgid"},{"line_number":607,"context_line":"        path \u003d self._url(\u0027/v2/images/%s\u0027 % image_id)"},{"line_number":608,"context_line":"        data \u003d jsonutils.dumps([\"body\"])"},{"line_number":609,"context_line":"        response \u003d requests.get(path, headers\u003dself._headers(), data\u003ddata)"},{"line_number":610,"context_line":"        self.assertEqual(400, response.status_code)"},{"line_number":611,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_f7043216","line":608,"updated":"2015-08-04 10:33:16.000000000","message":"Nice tests.\n\nI\u0027d cover the cases where the body is legal json and the body isn\u0027t legal json.\n(ie keep what you have but add the other case for just one instance.)","commit_id":"85f7dccbad5b4a6760dfc9d7226f0002154453b3"},{"author":{"_account_id":16658,"name":"Darja Shakhray","email":"damalyavkina@gmail.com","username":"dshakhray"},"change_message_id":"49cddbdbb2345c0079dba1a5739af0ceafae1910","unresolved":false,"context_lines":[{"line_number":667,"context_line":"        image \u003d jsonutils.loads(response.text)"},{"line_number":668,"context_line":"        image_id \u003d image[\u0027id\u0027]"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"        # GET /images/imgid"},{"line_number":671,"context_line":"        path \u003d self._url(\u0027/v2/images/%s\u0027 % image_id)"},{"line_number":672,"context_line":"        data \u003d jsonutils.dumps([\"body\"])"},{"line_number":673,"context_line":"        response \u003d requests.get(path, headers\u003dself._headers(), data\u003ddata)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa80f949_49f8cc49","line":670,"updated":"2015-11-05 09:38:59.000000000","message":"Perhaps it would be better to create \"schema_urls\" and run in a loop like in lines 648-659?","commit_id":"7212c3ab0cf6bfe2108590fcc35db6ad8eef8e9b"},{"author":{"_account_id":16658,"name":"Darja Shakhray","email":"damalyavkina@gmail.com","username":"dshakhray"},"change_message_id":"12d379e365b39a4aa4c5c7e5abc96e04923b7d99","unresolved":false,"context_lines":[{"line_number":667,"context_line":"        image \u003d jsonutils.loads(response.text)"},{"line_number":668,"context_line":"        image_id \u003d image[\u0027id\u0027]"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"        # GET /images/imgid"},{"line_number":671,"context_line":"        path \u003d self._url(\u0027/v2/images/%s\u0027 % image_id)"},{"line_number":672,"context_line":"        data \u003d jsonutils.dumps([\"body\"])"},{"line_number":673,"context_line":"        response \u003d requests.get(path, headers\u003dself._headers(), data\u003ddata)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa80f949_35b11648","line":670,"in_reply_to":"fa80f949_3a4105aa","updated":"2015-11-05 12:09:31.000000000","message":"Yes, but 4 request GET, DELETE and 2 request POST can be united in separate loops","commit_id":"7212c3ab0cf6bfe2108590fcc35db6ad8eef8e9b"},{"author":{"_account_id":17116,"name":"Niall Bunting","email":"niall.bunting@hpe.com","username":"NiallBunting"},"change_message_id":"08f63a6eef4424df6b40dc3f0d2a6cbc36cbc9d2","unresolved":false,"context_lines":[{"line_number":667,"context_line":"        image \u003d jsonutils.loads(response.text)"},{"line_number":668,"context_line":"        image_id \u003d image[\u0027id\u0027]"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"        # GET /images/imgid"},{"line_number":671,"context_line":"        path \u003d self._url(\u0027/v2/images/%s\u0027 % image_id)"},{"line_number":672,"context_line":"        data \u003d jsonutils.dumps([\"body\"])"},{"line_number":673,"context_line":"        response \u003d requests.get(path, headers\u003dself._headers(), data\u003ddata)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa80f949_3a4105aa","line":670,"in_reply_to":"fa80f949_49f8cc49","updated":"2015-11-05 11:56:36.000000000","message":"There are many subtle differences, such as put/post/get and if it includes the TENANT.","commit_id":"7212c3ab0cf6bfe2108590fcc35db6ad8eef8e9b"},{"author":{"_account_id":16658,"name":"Darja Shakhray","email":"damalyavkina@gmail.com","username":"dshakhray"},"change_message_id":"5286e5a1e46c7398db44fe897e7475ab1071b2ab","unresolved":false,"context_lines":[{"line_number":706,"context_line":"        # DELETE /images/imgid/members/memid"},{"line_number":707,"context_line":"        path \u003d self._url(\u0027/v2/images/%s/members/%s\u0027 % (image_id, TENANT3))"},{"line_number":708,"context_line":"        data \u003d jsonutils.dumps([\"body\"])"},{"line_number":709,"context_line":"        response \u003d requests.get(path, headers\u003dself._headers(), data\u003ddata)"},{"line_number":710,"context_line":"        self.assertEqual(400, response.status_code)"},{"line_number":711,"context_line":""},{"line_number":712,"context_line":"        self.stop_servers()"}],"source_content_type":"text/x-python","patch_set":9,"id":"fa80f949_46a66b11","line":709,"updated":"2015-11-05 14:59:56.000000000","message":"You send GET instead of DELETE","commit_id":"43a4cd78877f09d751e4e3343894fb870f1d32aa"}]}
