)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"ff5e7ff107ee53b4f534a4f511401efc872685cf","unresolved":false,"context_lines":[{"line_number":17,"context_line":"  create an image with duplicate property names in the request, as"},{"line_number":18,"context_line":"  (unlike for v2) the current behavior does not cause a 500 (and"},{"line_number":19,"context_line":"  hopefully v1 won\u0027t be around too much longer anyway)."},{"line_number":20,"context_line":"  ** using python-glanceclient: the first property name/value pair"},{"line_number":21,"context_line":"     is used, the other is ignored; property name is created as"},{"line_number":22,"context_line":"     all-lowercase regardless of how it was specified"},{"line_number":23,"context_line":"  ** using v1 API directly: single all-lowercase property name is"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ba0121b8_a9a56905","line":20,"range":{"start_line":20,"start_character":5,"end_line":20,"end_character":31},"updated":"2016-03-29 12:36:43.000000000","message":"I first read \u0027using python-glanceclient\u0027 to mean both v1 and v2. I see now this is v1 only. We could say \u0027using v1 API via python-glanceclient:\u0027.","commit_id":"65170ae3811635a7384f1269af3bea0ff738f10b"}],"glance/common/exception.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"394401065fd4e20793c6d16817f68d2c12bdddce","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    message \u003d _(\"Image property \u0027%(property_name)s\u0027 duplicates an existing \""},{"line_number":87,"context_line":"                \"property name.\")"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __init__(self, message\u003dNone, *args, **kwargs):"},{"line_number":90,"context_line":"        self.property_name \u003d kwargs.get(\"property_name\")"},{"line_number":91,"context_line":"        super(DuplicatePropertyName, self).__init__(message, *args, **kwargs)"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_8ce58a39","line":89,"range":{"start_line":89,"start_character":4,"end_line":89,"end_character":7},"updated":"2016-03-18 02:42:19.000000000","message":"you don\u0027t need to do this. in fact, it will override the message.","commit_id":"65170ae3811635a7384f1269af3bea0ff738f10b"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"024fee0725dd886ec640765c7078b8b176541bce","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    message \u003d _(\"Image property \u0027%(property_name)s\u0027 duplicates an existing \""},{"line_number":87,"context_line":"                \"property name.\")"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __init__(self, message\u003dNone, *args, **kwargs):"},{"line_number":90,"context_line":"        self.property_name \u003d kwargs.get(\"property_name\")"},{"line_number":91,"context_line":"        super(DuplicatePropertyName, self).__init__(message, *args, **kwargs)"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_7f7cb120","line":89,"range":{"start_line":89,"start_character":4,"end_line":89,"end_character":7},"in_reply_to":"1af94dfe_8ce58a39","updated":"2016-03-29 02:09:46.000000000","message":"Actually, it doesn\u0027t.  The parameter is different from self.message, and when the superclass __init__() is called, if the value of the \u0027message\u0027 argument is None, __init__ uses self.message, which at that point will be the \u0027message\u0027 var defined in DuplicatePropertyName.  So if you have a \u0027message\u0027 argument when the DuplicatePropertyName instance is created, it will get passed through and used; if you set message\u003dNone, or omit the message argument, it will use the \u0027message\u0027 defined in DuplicatePropertyName.  (Only telling you all this because I was able to make it work in code, and it took me a few minutes to figure out how to explain what was going on.)\n\nBut the real point is that I want this class to have its own __init__ method so I can store the property_name in a particular exception.  The default message covers most situations, but there was at least one place where I caught the exception and needed to use the property_name to create an appropriate message.","commit_id":"65170ae3811635a7384f1269af3bea0ff738f10b"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"d43dff129dd5b479ce390d0b8a6b80d6a815b922","unresolved":false,"context_lines":[{"line_number":86,"context_line":"    message \u003d _(\"Image property \u0027%(property_name)s\u0027 duplicates an existing \""},{"line_number":87,"context_line":"                \"property name.\")"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def __init__(self, message\u003dNone, *args, **kwargs):"},{"line_number":90,"context_line":"        self.property_name \u003d kwargs.get(\"property_name\")"},{"line_number":91,"context_line":"        super(DuplicatePropertyName, self).__init__(message, *args, **kwargs)"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a061dce_312817e2","line":89,"range":{"start_line":89,"start_character":4,"end_line":89,"end_character":7},"in_reply_to":"ba0121b8_7f7cb120","updated":"2016-04-06 23:53:22.000000000","message":"I see, that\u0027s really good observation on this behavior. I guess the message attr from this class was being passed and I ignored that. The check on the super class is ensuring some safety too.\n\nHowever, if you see exceptions on lines 136, 141, 341, etc. all of them use the inheritance and subsequent formatting as message element for this class has that definition. So you won\u0027t need a __init__ for this class and can simple be happy with the new definition of message.","commit_id":"65170ae3811635a7384f1269af3bea0ff738f10b"}],"glance/registry/api/v1/images.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"394401065fd4e20793c6d16817f68d2c12bdddce","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            LOG.info(_LI(\"Rejecting image creation request for invalid image \""},{"line_number":409,"context_line":"                         \"id \u0027%(bad_id)s\u0027\"), {\u0027bad_id\u0027: image_id})"},{"line_number":410,"context_line":"            msg \u003d _(\"Invalid image id format\")"},{"line_number":411,"context_line":"            #TODO(rosmaita): why return instead of raise here?"},{"line_number":412,"context_line":"            return exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"        if \u0027location\u0027 in image_data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_ec5c0e7f","line":411,"range":{"start_line":411,"start_character":29,"end_line":411,"end_character":32},"updated":"2016-03-18 02:42:19.000000000","message":"good point. but prolly a diff patch. I think it\u0027s a bug but we\u0027ll have to confirm.","commit_id":"65170ae3811635a7384f1269af3bea0ff738f10b"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"024fee0725dd886ec640765c7078b8b176541bce","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            LOG.info(_LI(\"Rejecting image creation request for invalid image \""},{"line_number":409,"context_line":"                         \"id \u0027%(bad_id)s\u0027\"), {\u0027bad_id\u0027: image_id})"},{"line_number":410,"context_line":"            msg \u003d _(\"Invalid image id format\")"},{"line_number":411,"context_line":"            #TODO(rosmaita): why return instead of raise here?"},{"line_number":412,"context_line":"            return exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"        if \u0027location\u0027 in image_data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_9f73854d","line":411,"range":{"start_line":411,"start_character":29,"end_line":411,"end_character":32},"in_reply_to":"1af94dfe_ec5c0e7f","updated":"2016-03-29 02:09:46.000000000","message":"I agree a different patch.  I experimented a bit, and it seems to work either way, but I think raise is more appropriate.","commit_id":"65170ae3811635a7384f1269af3bea0ff738f10b"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"d43dff129dd5b479ce390d0b8a6b80d6a815b922","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            LOG.info(_LI(\"Rejecting image creation request for invalid image \""},{"line_number":409,"context_line":"                         \"id \u0027%(bad_id)s\u0027\"), {\u0027bad_id\u0027: image_id})"},{"line_number":410,"context_line":"            msg \u003d _(\"Invalid image id format\")"},{"line_number":411,"context_line":"            #TODO(rosmaita): why return instead of raise here?"},{"line_number":412,"context_line":"            return exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"        if \u0027location\u0027 in image_data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a061dce_b14b8786","line":411,"range":{"start_line":411,"start_character":29,"end_line":411,"end_character":32},"in_reply_to":"ba0121b8_80ab0f89","updated":"2016-04-06 23:53:22.000000000","message":"Did a test on the behavior of the return vs. raise of exceptions:\n\n...\n\n\u003e\u003e\u003e def return_exc():\n...     return IOError()\n...\n\u003e\u003e\u003e def raise_exc():\n...     raise IOError()\n...\n\u003e\u003e\u003e ret \u003d return_exc()\n\u003e\u003e\u003e rse \u003d raise_exc()\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"\u003cstdin\u003e\", line 2, in raise_exc\nIOError\n\u003e\u003e\u003e ret\nIOError()\n\u003e\u003e\u003e\n\n...\n\nSo, the return is passing the instance of the exception rather than a exception trace itself.","commit_id":"65170ae3811635a7384f1269af3bea0ff738f10b"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"ff5e7ff107ee53b4f534a4f511401efc872685cf","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            LOG.info(_LI(\"Rejecting image creation request for invalid image \""},{"line_number":409,"context_line":"                         \"id \u0027%(bad_id)s\u0027\"), {\u0027bad_id\u0027: image_id})"},{"line_number":410,"context_line":"            msg \u003d _(\"Invalid image id format\")"},{"line_number":411,"context_line":"            #TODO(rosmaita): why return instead of raise here?"},{"line_number":412,"context_line":"            return exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"        if \u0027location\u0027 in image_data:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_80ab0f89","line":411,"range":{"start_line":411,"start_character":29,"end_line":411,"end_character":32},"in_reply_to":"ba0121b8_9f73854d","updated":"2016-03-29 12:36:43.000000000","message":"I pushed this up to Cinder:\n\nhttps://review.openstack.org/#/c/298706/\n\n(they seemed to also have a mix of raise/return for webob exceptions). Let\u0027s see what they say.","commit_id":"65170ae3811635a7384f1269af3bea0ff738f10b"}]}
