)]}'
{"glance/api/v2/images.py":[{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"5164f4e0f20b224bae5b5bd3b5eb334ba2dfa56e","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            for change in changes:"},{"line_number":142,"context_line":"                change_method_name \u003d \u0027_do_%s\u0027 % change[\u0027op\u0027]"},{"line_number":143,"context_line":"                if not hasattr(self, change_method_name):"},{"line_number":144,"context_line":"                    msg \u003d _(\"Invalid operation type %s\")"},{"line_number":145,"context_line":"                    raise webob.exc.HTTPBadRequest(msg % change[\u0027op\u0027])"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                change_method \u003d getattr(self, change_method_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_3dac6e9f","line":144,"updated":"2015-05-18 17:02:41.000000000","message":"I\u0027d add some more info in exception message regarding PATCH operation","commit_id":"b3c65c3353297e7051a42ec26ef5de75a20f7978"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"b95ed59ae1cfb2f119ae1c063cb63a95b348e175","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            for change in changes:"},{"line_number":142,"context_line":"                change_method_name \u003d \u0027_do_%s\u0027 % change[\u0027op\u0027]"},{"line_number":143,"context_line":"                if not hasattr(self, change_method_name):"},{"line_number":144,"context_line":"                    msg \u003d _(\"Invalid operation type %s\")"},{"line_number":145,"context_line":"                    raise webob.exc.HTTPBadRequest(msg % change[\u0027op\u0027])"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                change_method \u003d getattr(self, change_method_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_a0338313","line":144,"in_reply_to":"7a016987_0b75dd62","updated":"2015-05-19 11:59:03.000000000","message":"Something like \u0027Invalid PATCH operation type, allowed values [...]\u0027\n\nBut that\u0027s a super minor nit, so you may ignore it.","commit_id":"b3c65c3353297e7051a42ec26ef5de75a20f7978"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"f90aab263493bbe46855a648c6ea484801c9c159","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            for change in changes:"},{"line_number":142,"context_line":"                change_method_name \u003d \u0027_do_%s\u0027 % change[\u0027op\u0027]"},{"line_number":143,"context_line":"                if not hasattr(self, change_method_name):"},{"line_number":144,"context_line":"                    msg \u003d _(\"Invalid operation type %s\")"},{"line_number":145,"context_line":"                    raise webob.exc.HTTPBadRequest(msg % change[\u0027op\u0027])"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                change_method \u003d getattr(self, change_method_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_0b75dd62","line":144,"in_reply_to":"7a016987_3dac6e9f","updated":"2015-05-19 09:44:44.000000000","message":"Any ideas for extending the message?","commit_id":"b3c65c3353297e7051a42ec26ef5de75a20f7978"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"f89173843ff58f0496f1fc277ee602ee1c9dddfe","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            for change in changes:"},{"line_number":142,"context_line":"                change_method_name \u003d \u0027_do_%s\u0027 % change[\u0027op\u0027]"},{"line_number":143,"context_line":"                if not hasattr(self, change_method_name):"},{"line_number":144,"context_line":"                    msg \u003d _(\"Invalid operation type %s\")"},{"line_number":145,"context_line":"                    raise webob.exc.HTTPBadRequest(msg % change[\u0027op\u0027])"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"                change_method \u003d getattr(self, change_method_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a016987_9a58e48b","line":144,"in_reply_to":"7a016987_a0338313","updated":"2015-05-25 08:29:56.000000000","message":"Like it. I\u0027ve looked again over the file and I guess that _get_change_operation_d10 would be better for such validation.","commit_id":"b3c65c3353297e7051a42ec26ef5de75a20f7978"},{"author":{"_account_id":13717,"name":"Inessa Vasilevskaya","email":"ivasilevskaya@mirantis.com","username":"ivasilevskaya"},"change_message_id":"c06b0fa7caf3e50100a58f58d5d96fc7a680ea7e","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        try:"},{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                raise ValueError"},{"line_number":379,"context_line":"        except KeyError:"},{"line_number":380,"context_line":"            msg \u003d _(\"Unable to find \u0027%s\u0027 in JSON Schema change\") % \u0027op\u0027"},{"line_number":381,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_06167af1","line":378,"updated":"2015-05-25 14:13:16.000000000","message":"A bit overcomplicated to me: what\u0027s the reason to raise ValueError that will be caught and processed a couple of lines later just to result in HTTPBadRequest? Why not simply raise HTTPBadRequest?\n\ntry:\n    op \u003d raw_change[\u0027op\u0027]\n    if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):\n        msg \u003d \"Invalid value ... \"\n        raise webob.exc.HTTPBadRequest(explanation\u003dmsg)\n    return op\nexcept KeyError:\n    msg \u003d \"Unable to find ...\"\n    raise webob.exc.HTTPBadRequest(explanation\u003dmsg)","commit_id":"69f498f6e058f5aa48d5f59c664d2a742801d88a"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"436f84d3c793f6d80865469b9ddc3fdab082363e","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        try:"},{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                raise ValueError"},{"line_number":379,"context_line":"        except KeyError:"},{"line_number":380,"context_line":"            msg \u003d _(\"Unable to find \u0027%s\u0027 in JSON Schema change\") % \u0027op\u0027"},{"line_number":381,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_db639740","line":378,"in_reply_to":"7a016987_06167af1","updated":"2015-05-25 21:23:24.000000000","message":"+1 for throw the HTTP exception directly, just like we did at line 393.","commit_id":"69f498f6e058f5aa48d5f59c664d2a742801d88a"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"2a3bd78f94c3a93ab43318fc5d4d9345ddc17b8b","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        try:"},{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                raise ValueError"},{"line_number":379,"context_line":"        except KeyError:"},{"line_number":380,"context_line":"            msg \u003d _(\"Unable to find \u0027%s\u0027 in JSON Schema change\") % \u0027op\u0027"},{"line_number":381,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_923e1928","line":378,"in_reply_to":"7a016987_06167af1","updated":"2015-05-26 07:51:36.000000000","message":"Agree, it can be simplified using the approach you have provided. Thanks :)","commit_id":"69f498f6e058f5aa48d5f59c664d2a742801d88a"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"2a3bd78f94c3a93ab43318fc5d4d9345ddc17b8b","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        try:"},{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                raise ValueError"},{"line_number":379,"context_line":"        except KeyError:"},{"line_number":380,"context_line":"            msg \u003d _(\"Unable to find \u0027%s\u0027 in JSON Schema change\") % \u0027op\u0027"},{"line_number":381,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_723b9d39","line":378,"in_reply_to":"7a016987_db639740","updated":"2015-05-26 07:51:36.000000000","message":"Done","commit_id":"69f498f6e058f5aa48d5f59c664d2a742801d88a"},{"author":{"_account_id":15168,"name":"Kirill Zaitsev","email":"k.zaitsev@me.com","username":"kzaitsev"},"change_message_id":"b796dbe5ae91bf88c0bd3153207703791e551421","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        try:"},{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                msg \u003d _(\"Invalid \u0027%s\u0027 value in JSON Schema change. Allowed \""},{"line_number":379,"context_line":"                        \"values are \u0027add\u0027, \u0027remove\u0027, \u0027replace\u0027.\") % \u0027op\u0027"},{"line_number":380,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":381,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3afb71cf_d33e378a","line":378,"updated":"2015-06-09 22:19:12.000000000","message":"It would be nice to add op value in the response, to let user know what it was.","commit_id":"15996b06f7151c090f56b2e372cc2924e6f866bd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"43063f9977d3826c7f69ba91ee04216b5b5183fd","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        try:"},{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                msg \u003d _(\"Invalid \u0027%s\u0027 value in JSON Schema change. Allowed \""},{"line_number":379,"context_line":"                        \"values are \u0027add\u0027, \u0027remove\u0027, \u0027replace\u0027.\") % \u0027op\u0027"},{"line_number":380,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":381,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3afb71cf_db43de11","line":378,"in_reply_to":"3afb71cf_d33e378a","updated":"2015-06-10 08:31:03.000000000","message":"+1","commit_id":"15996b06f7151c090f56b2e372cc2924e6f866bd"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"8a1a079a3b366f0e32199601daa7d2c37f8b2d9c","unresolved":false,"context_lines":[{"line_number":375,"context_line":"        try:"},{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                msg \u003d _(\"Invalid \u0027%s\u0027 value in JSON Schema change. Allowed \""},{"line_number":379,"context_line":"                        \"values are \u0027add\u0027, \u0027remove\u0027, \u0027replace\u0027.\") % \u0027op\u0027"},{"line_number":380,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":381,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1af86dd1_dbb4a9d2","line":378,"in_reply_to":"3afb71cf_d33e378a","updated":"2015-06-12 09:22:59.000000000","message":"Done","commit_id":"15996b06f7151c090f56b2e372cc2924e6f866bd"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"b7e4a2764e475d80344b26c19727a878de9187e4","unresolved":false,"context_lines":[{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                msg \u003d _(\"Invalid \u0027%s\u0027 value in JSON Schema change. Allowed \""},{"line_number":379,"context_line":"                        \"values are \u0027add\u0027, \u0027remove\u0027, \u0027replace\u0027.\") % \u0027op\u0027"},{"line_number":380,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":381,"context_line":"        except KeyError:"},{"line_number":382,"context_line":"            msg \u003d _(\"Unable to find \u0027%s\u0027 in JSON Schema change\") % \u0027op\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"1af86dd1_b802133d","line":379,"updated":"2015-06-12 08:57:45.000000000","message":"I think you meant `op` instead of `\u0027op\u0027`. I see it\u0027s wrong in L382 as well.","commit_id":"15996b06f7151c090f56b2e372cc2924e6f866bd"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"da745563f8a856abb8094644c6cd49d2a13ecc93","unresolved":false,"context_lines":[{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                msg \u003d _(\"Invalid \u0027%s\u0027 value in JSON Schema change. Allowed \""},{"line_number":379,"context_line":"                        \"values are \u0027add\u0027, \u0027remove\u0027, \u0027replace\u0027.\") % \u0027op\u0027"},{"line_number":380,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":381,"context_line":"        except KeyError:"},{"line_number":382,"context_line":"            msg \u003d _(\"Unable to find \u0027%s\u0027 in JSON Schema change\") % \u0027op\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"1af86dd1_db02696f","line":379,"in_reply_to":"1af86dd1_7bc4953f","updated":"2015-06-12 09:25:32.000000000","message":"I mean right now it would be just \u0027op\u0027 not `\u0027op\u0027`. But in L434 we are using ` instead of \u0027, so gonna change it.","commit_id":"15996b06f7151c090f56b2e372cc2924e6f866bd"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"8a1a079a3b366f0e32199601daa7d2c37f8b2d9c","unresolved":false,"context_lines":[{"line_number":376,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":377,"context_line":"            if op not in (\u0027replace\u0027, \u0027add\u0027, \u0027remove\u0027):"},{"line_number":378,"context_line":"                msg \u003d _(\"Invalid \u0027%s\u0027 value in JSON Schema change. Allowed \""},{"line_number":379,"context_line":"                        \"values are \u0027add\u0027, \u0027remove\u0027, \u0027replace\u0027.\") % \u0027op\u0027"},{"line_number":380,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":381,"context_line":"        except KeyError:"},{"line_number":382,"context_line":"            msg \u003d _(\"Unable to find \u0027%s\u0027 in JSON Schema change\") % \u0027op\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"1af86dd1_7bc4953f","line":379,"in_reply_to":"1af86dd1_b802133d","updated":"2015-06-12 09:22:59.000000000","message":"Yup, you are right. Done.","commit_id":"15996b06f7151c090f56b2e372cc2924e6f866bd"},{"author":{"_account_id":15168,"name":"Kirill Zaitsev","email":"k.zaitsev@me.com","username":"kzaitsev"},"change_message_id":"3963cc4c01d148d0ecc6bfdec30a2c282b25e7ae","unresolved":false,"context_lines":[{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _get_change_operation_d10(self, raw_change):"},{"line_number":377,"context_line":"        try:"},{"line_number":378,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":379,"context_line":"            if op not in self._supported_operations:"},{"line_number":380,"context_line":"                msg \u003d _(\u0027Invalid operation: `%(op)s`. \u0027"},{"line_number":381,"context_line":"                        \u0027It must be one of the following: %(available)s.\u0027) % \\"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_5063ceb1","line":378,"updated":"2015-06-13 21:51:17.000000000","message":"Can we maybe remove this whole try/except and change it to\n\nop \u003d raw_change.get(\u0027op\u0027) ?\n\nThe following code would then return a 400 if op would be empty and would indicate that empty op is not a supported operation. And inner HTTPBadRequest\u0027s explanation is a lot more informative IMO.\n\nThis would make code a lot more readable.","commit_id":"2d83e9eee95ce621949877f8a42fdcf1a02b647e"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"dc9080ec4a009e5cf25542093905102f4311c259","unresolved":false,"context_lines":[{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _get_change_operation_d10(self, raw_change):"},{"line_number":377,"context_line":"        try:"},{"line_number":378,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":379,"context_line":"            if op not in self._supported_operations:"},{"line_number":380,"context_line":"                msg \u003d _(\u0027Invalid operation: `%(op)s`. \u0027"},{"line_number":381,"context_line":"                        \u0027It must be one of the following: %(available)s.\u0027) % \\"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_d948505e","line":378,"in_reply_to":"fa32b979_5063ceb1","updated":"2015-06-15 11:20:20.000000000","message":"TBH, I\u0027m not really sure if this deserves a -1, but I won\u0027t +2 without adopting above comments. Since it makes more sense for me. Thanks.","commit_id":"2d83e9eee95ce621949877f8a42fdcf1a02b647e"},{"author":{"_account_id":13161,"name":"Kamil Rykowski","email":"kamil.rykowski@gmail.com","username":"krykowski"},"change_message_id":"a7b0d0179c5341ae52ce064fc2941917bdf82bcb","unresolved":false,"context_lines":[{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _get_change_operation_d10(self, raw_change):"},{"line_number":377,"context_line":"        try:"},{"line_number":378,"context_line":"            op \u003d raw_change[\u0027op\u0027]"},{"line_number":379,"context_line":"            if op not in self._supported_operations:"},{"line_number":380,"context_line":"                msg \u003d _(\u0027Invalid operation: `%(op)s`. \u0027"},{"line_number":381,"context_line":"                        \u0027It must be one of the following: %(available)s.\u0027) % \\"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_221b181d","line":378,"in_reply_to":"fa32b979_5063ceb1","updated":"2015-06-16 06:30:30.000000000","message":"Thanks! Done :)","commit_id":"2d83e9eee95ce621949877f8a42fdcf1a02b647e"}]}
