)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"2254fac9911528be00cdbe790a8c30414f226714","unresolved":false,"context_lines":[{"line_number":12,"context_line":"to guard against requests occuring during the processing of a valid"},{"line_number":13,"context_line":"upload request by refusing to service any further requests while"},{"line_number":14,"context_line":"the image is still \u0027saving\u0027."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Fixes: bug 1241025"},{"line_number":17,"context_line":"Change-Id: Ie532b61484bec660910fb9a37429397bde8ef11f"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"AAAATX%2F%2F%2B4I%3D","line":15,"updated":"2013-10-23 10:30:52.000000000","message":"nit: I read the last sentence as \u0027we will stop processing all requests of any type\u0027 while an image upload is occurring. Would it be worth making it clearer that that\u0027s not the case? eg that we are only stopping new data uploads relating to any images in a saving state?","commit_id":"b336c2d7d4604ec26b1ffd05f5b3be4151805a20"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"2323d3357561c78c6db47fd5f1f43f7c277d4b32","unresolved":false,"context_lines":[{"line_number":12,"context_line":"to guard against requests occuring during the processing of a valid"},{"line_number":13,"context_line":"upload request by refusing to service any further requests while"},{"line_number":14,"context_line":"the image is still \u0027saving\u0027."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Fixes: bug 1241025"},{"line_number":17,"context_line":"Change-Id: Ie532b61484bec660910fb9a37429397bde8ef11f"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"AAAATX%2F%2F9aA%3D","line":15,"in_reply_to":"AAAATX%2F%2F%2B4I%3D","updated":"2013-10-23 16:49:04.000000000","message":"Done","commit_id":"b336c2d7d4604ec26b1ffd05f5b3be4151805a20"}],"glance/api/v1/images.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"7f5b7c330eba9fdf054350326570939af18352e2","unresolved":false,"context_lines":[{"line_number":860,"context_line":"            raise HTTPForbidden(explanation\u003dmsg,"},{"line_number":861,"context_line":"                                request\u003dreq,"},{"line_number":862,"context_line":"                                content_type\u003d\"text/plain\")"},{"line_number":863,"context_line":"        except exception.Conflict as e:"},{"line_number":864,"context_line":"            LOG.info(str(e))"},{"line_number":865,"context_line":"            raise HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":866,"context_line":"                                   request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2FKyk%3D","line":863,"updated":"2013-10-22 04:34:07.000000000","message":"webob.exc.HTTPConflict (409) will be convert to glance.common.exception.Duplicate at https://github.com/openstack/glance/blob/master/glance/common/client.py#L530 , so IMO here should we catch \"exception.Duplicate\"?","commit_id":"fd45bb430424dd63da2b11c6df8fb4101f3832f2"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"a97efb3e94b7d0e5bf3e1890c8698985e3ade212","unresolved":false,"context_lines":[{"line_number":860,"context_line":"            raise HTTPForbidden(explanation\u003dmsg,"},{"line_number":861,"context_line":"                                request\u003dreq,"},{"line_number":862,"context_line":"                                content_type\u003d\"text/plain\")"},{"line_number":863,"context_line":"        except exception.Conflict as e:"},{"line_number":864,"context_line":"            LOG.info(str(e))"},{"line_number":865,"context_line":"            raise HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":866,"context_line":"                                   request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATX%2F%2F9a8%3D","line":863,"in_reply_to":"AAAATH%2F%2FHlE%3D","updated":"2013-10-23 16:48:55.000000000","message":"I\u0027m confused here is that in above try block, there have not any calls can trigger db.image_update() except registry.update_image_metadata(). Actually in image v1 controller (this file), all image metadata (db) operations are all be executed by registry service but by controller directly.","commit_id":"fd45bb430424dd63da2b11c6df8fb4101f3832f2"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"2df8c0e2416b9788774817c6520f236e3fb31d98","unresolved":false,"context_lines":[{"line_number":860,"context_line":"            raise HTTPForbidden(explanation\u003dmsg,"},{"line_number":861,"context_line":"                                request\u003dreq,"},{"line_number":862,"context_line":"                                content_type\u003d\"text/plain\")"},{"line_number":863,"context_line":"        except exception.Conflict as e:"},{"line_number":864,"context_line":"            LOG.info(str(e))"},{"line_number":865,"context_line":"            raise HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":866,"context_line":"                                   request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2FHlE%3D","line":863,"in_reply_to":"AAAATH%2F%2FKyk%3D","updated":"2013-10-22 22:24:17.000000000","message":"exception.Conflict is raised by the db api so we need to catch it here. For exception raised in registry call you are correct i.e. Duplicate would be returned since it is converted (I reckon we should review this since HTTConflict makes more sense than duplicate in case of a race condition but we can leave it for now).","commit_id":"fd45bb430424dd63da2b11c6df8fb4101f3832f2"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"a97efb3e94b7d0e5bf3e1890c8698985e3ade212","unresolved":false,"context_lines":[{"line_number":861,"context_line":"                                request\u003dreq,"},{"line_number":862,"context_line":"                                content_type\u003d\"text/plain\")"},{"line_number":863,"context_line":"        except exception.Conflict as e:"},{"line_number":864,"context_line":"            LOG.info(str(e))"},{"line_number":865,"context_line":"            raise HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":866,"context_line":"                                   request\u003dreq,"},{"line_number":867,"context_line":"                                   content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATX%2F%2F9aU%3D","line":864,"updated":"2013-10-23 16:48:55.000000000","message":"I prefer go unicode way to prevent potential conversion failure: LOG.info(unicode(e))","commit_id":"fd45bb430424dd63da2b11c6df8fb4101f3832f2"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"3b43b6bca21c666d841367c385c988a120c8d2ab","unresolved":false,"context_lines":[{"line_number":861,"context_line":"                                request\u003dreq,"},{"line_number":862,"context_line":"                                content_type\u003d\"text/plain\")"},{"line_number":863,"context_line":"        except (exception.Conflict, exception.Duplicate) as e:"},{"line_number":864,"context_line":"            LOG.info(str(e))"},{"line_number":865,"context_line":"            raise HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":866,"context_line":"                               request\u003dreq,"},{"line_number":867,"context_line":"                               content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2F%2Fao%3D","line":864,"updated":"2013-10-24 06:26:21.000000000","message":"nit: I prefer go unicode way to prevent potential conversion failure: LOG.info(unicode(e))","commit_id":"761808d2c12930ddad9755fa947603e2bd2c54b1"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"c82ddb1cf8673245f2c556f7da454d90fbfebd97","unresolved":false,"context_lines":[{"line_number":861,"context_line":"                                request\u003dreq,"},{"line_number":862,"context_line":"                                content_type\u003d\"text/plain\")"},{"line_number":863,"context_line":"        except (exception.Conflict, exception.Duplicate) as e:"},{"line_number":864,"context_line":"            LOG.info(str(e))"},{"line_number":865,"context_line":"            raise HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":866,"context_line":"                               request\u003dreq,"},{"line_number":867,"context_line":"                               content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2F9Mg%3D","line":864,"in_reply_to":"AAAATn%2F%2F%2Fao%3D","updated":"2013-10-24 16:32:19.000000000","message":"Done","commit_id":"761808d2c12930ddad9755fa947603e2bd2c54b1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"40ec05588135390f9a17c63d4a2a998b0c678097","unresolved":false,"context_lines":[{"line_number":621,"context_line":"            self.notifier.info(\"image.activate\", redact_loc(image_meta_data))"},{"line_number":622,"context_line":"            self.notifier.info(\"image.update\", redact_loc(image_meta_data))"},{"line_number":623,"context_line":"            return image_meta_data"},{"line_number":624,"context_line":"        except exception.Duplicate as e:"},{"line_number":625,"context_line":"            # Delete image data since it has been supersceded by another"},{"line_number":626,"context_line":"            # upload."},{"line_number":627,"context_line":"            LOG.debug(\"duplicate operation - deleting image data for %s \""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F85A8%3D","line":624,"updated":"2013-12-19 05:06:33.000000000","message":"nit: unused var \"e\"","commit_id":"f502d93715a86d376e294bae1cb9967f27f56a01"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"3518e19386fd7cd8f1010981fe9ea09aebf9b447","unresolved":false,"context_lines":[{"line_number":621,"context_line":"            self.notifier.info(\"image.activate\", redact_loc(image_meta_data))"},{"line_number":622,"context_line":"            self.notifier.info(\"image.update\", redact_loc(image_meta_data))"},{"line_number":623,"context_line":"            return image_meta_data"},{"line_number":624,"context_line":"        except exception.Duplicate as e:"},{"line_number":625,"context_line":"            # Delete image data since it has been supersceded by another"},{"line_number":626,"context_line":"            # upload."},{"line_number":627,"context_line":"            LOG.debug(\"duplicate operation - deleting image data for %s \""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F825I%3D","line":624,"in_reply_to":"AAAATn%2F85A8%3D","updated":"2013-12-19 14:27:17.000000000","message":"Done","commit_id":"f502d93715a86d376e294bae1cb9967f27f56a01"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"40ec05588135390f9a17c63d4a2a998b0c678097","unresolved":false,"context_lines":[{"line_number":990,"context_line":"        try:"},{"line_number":991,"context_line":"            # Delete the image from the registry first, since we rely on it"},{"line_number":992,"context_line":"            # for authorization checks."},{"line_number":993,"context_line":"            # See https://bugs.launchpad.net/glance/+bug/1065187"},{"line_number":994,"context_line":"            image \u003d registry.update_image_metadata(req.context, id,"},{"line_number":995,"context_line":"                                                   {\u0027status\u0027: status})"},{"line_number":996,"context_line":"            registry.delete_image_metadata(req.context, id)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F84%2F4%3D","line":993,"updated":"2013-12-19 05:06:33.000000000","message":"so I think we\u0027d better also do what we did at line #935","commit_id":"f502d93715a86d376e294bae1cb9967f27f56a01"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"3518e19386fd7cd8f1010981fe9ea09aebf9b447","unresolved":false,"context_lines":[{"line_number":990,"context_line":"        try:"},{"line_number":991,"context_line":"            # Delete the image from the registry first, since we rely on it"},{"line_number":992,"context_line":"            # for authorization checks."},{"line_number":993,"context_line":"            # See https://bugs.launchpad.net/glance/+bug/1065187"},{"line_number":994,"context_line":"            image \u003d registry.update_image_metadata(req.context, id,"},{"line_number":995,"context_line":"                                                   {\u0027status\u0027: status})"},{"line_number":996,"context_line":"            registry.delete_image_metadata(req.context, id)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F83I0%3D","line":993,"in_reply_to":"AAAATn%2F84%2F4%3D","updated":"2013-12-19 14:27:17.000000000","message":"I\u0027d rather keep this patchset specific to uploads. I have another patch to resolve deletion contention that I have postponed until this gets merged - https://review.openstack.org/#/c/50457/\n\nI will modify 50457 accordingly once I merge this in.","commit_id":"f502d93715a86d376e294bae1cb9967f27f56a01"}],"glance/db/sqlalchemy/api.py":[{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"2254fac9911528be00cdbe790a8c30414f226714","unresolved":false,"context_lines":[{"line_number":780,"context_line":"def _check_status(image, new_status):"},{"line_number":781,"context_line":"    \"\"\"If an update is being performed and the image is in \u0027saving\u0027 state, do"},{"line_number":782,"context_line":"    not allow any operation that is trying to set the image to \u0027saving\u0027 since"},{"line_number":783,"context_line":"    this would indicate a conflict.\"\"\""},{"line_number":784,"context_line":"    if (image.status \u003d\u003d \u0027saving\u0027) and (not image.locations) and \\"},{"line_number":785,"context_line":"       (new_status \u003d\u003d \u0027saving\u0027):"},{"line_number":786,"context_line":"        msg \u003d _(\"cannot update image to \u0027saving\u0027 while upload is in \""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATX%2F%2F%2B34%3D","line":783,"updated":"2013-10-23 10:30:52.000000000","message":"nit: I think we typically put the final \"\"\" on a new line for mutli-line comments?\nSee HACKING.rst","commit_id":"b336c2d7d4604ec26b1ffd05f5b3be4151805a20"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"2323d3357561c78c6db47fd5f1f43f7c277d4b32","unresolved":false,"context_lines":[{"line_number":780,"context_line":"def _check_status(image, new_status):"},{"line_number":781,"context_line":"    \"\"\"If an update is being performed and the image is in \u0027saving\u0027 state, do"},{"line_number":782,"context_line":"    not allow any operation that is trying to set the image to \u0027saving\u0027 since"},{"line_number":783,"context_line":"    this would indicate a conflict.\"\"\""},{"line_number":784,"context_line":"    if (image.status \u003d\u003d \u0027saving\u0027) and (not image.locations) and \\"},{"line_number":785,"context_line":"       (new_status \u003d\u003d \u0027saving\u0027):"},{"line_number":786,"context_line":"        msg \u003d _(\"cannot update image to \u0027saving\u0027 while upload is in \""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATX%2F%2F9a4%3D","line":783,"in_reply_to":"AAAATX%2F%2F%2B34%3D","updated":"2013-10-23 16:49:04.000000000","message":"Done","commit_id":"b336c2d7d4604ec26b1ffd05f5b3be4151805a20"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"e98b7d7731763f2951f0fabe5561e4f8c4b6fdd7","unresolved":false,"context_lines":[{"line_number":259,"context_line":"def image_create(context, values):"},{"line_number":260,"context_line":"    \"\"\"Create an image from the values dictionary.\"\"\""},{"line_number":261,"context_line":"    return _image_update(context, values, None, purge_props\u003dFalse,"},{"line_number":262,"context_line":"                         is_create\u003dTrue)"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"def image_update(context, image_id, values, purge_props\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9az0%3D","line":262,"updated":"2013-12-11 18:25:14.000000000","message":"I can\u0027t quite see why is_create is necessary. You get the same thing by setting image_id \u003d None as we do in this call. I\u0027m not sure that image_id\u003dNone is all that clear of an indicator, but I suppose I prefer we don\u0027t add new, duplicate semantics.","commit_id":"e4e94650d20e0451a3ac27bae1ed7824886edf59"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"129b0bf5b4a3008cb54aa8a2e1b535c838c4be2e","unresolved":false,"context_lines":[{"line_number":259,"context_line":"def image_create(context, values):"},{"line_number":260,"context_line":"    \"\"\"Create an image from the values dictionary.\"\"\""},{"line_number":261,"context_line":"    return _image_update(context, values, None, purge_props\u003dFalse,"},{"line_number":262,"context_line":"                         is_create\u003dTrue)"},{"line_number":263,"context_line":""},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"def image_update(context, image_id, values, purge_props\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAATn%2F9awU%3D","line":262,"in_reply_to":"AAAATn%2F9az0%3D","updated":"2013-12-11 18:30:21.000000000","message":"We should get the same result either way, this was mainly for clarity but i don\u0027t mind getting rid of it. I\u0027ll fix this up and get a new patch up asap.","commit_id":"e4e94650d20e0451a3ac27bae1ed7824886edf59"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"b340ba4b96b7a2ce894712f7194c91474e6e16d1","unresolved":false,"context_lines":[{"line_number":827,"context_line":"        values \u003d _validate_image(image_ref.to_dict())"},{"line_number":828,"context_line":"        _update_values(image_ref, values)"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"        try:"},{"line_number":831,"context_line":"            image_ref.save(session\u003dsession)"},{"line_number":832,"context_line":"        except sqlalchemy.exc.IntegrityError:"},{"line_number":833,"context_line":"            raise exception.Duplicate(\"Image ID %s already exists!\""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F9ExY%3D","line":830,"updated":"2013-12-17 02:05:30.000000000","message":"I think to completely eradicate this bug, we need to do the state checking *here*. In particular, we should be doing something like\n\n  session.query(models.Image).filter(id\u003dimage_id).filter(status\u003dcurrent_status).update(values)\n\nand check to see if the number of rows affected is 0 or 1.\n\nBut that seems like a lot. Maybe you just could alter the commit message to remove the comment about fixing the bug and go add a note to the bug that the race condition is substantially reduced by this patch.","commit_id":"0a59bef7342f3cffaa7835ec26d329a78c218c4e"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"f4afbadf33f35f13aed6be0ba5680c893ea043b0","unresolved":false,"context_lines":[{"line_number":827,"context_line":"        values \u003d _validate_image(image_ref.to_dict())"},{"line_number":828,"context_line":"        _update_values(image_ref, values)"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"        try:"},{"line_number":831,"context_line":"            image_ref.save(session\u003dsession)"},{"line_number":832,"context_line":"        except sqlalchemy.exc.IntegrityError:"},{"line_number":833,"context_line":"            raise exception.Duplicate(\"Image ID %s already exists!\""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAATn%2F9Byc%3D","line":830,"in_reply_to":"AAAATn%2F9ExY%3D","updated":"2013-12-17 14:55:55.000000000","message":"Yeah totally valid point. Ok so I\u0027ve hopefully fixed this now with an UPDATE WHERE as above. I enforced a synchronized\u003d\u0027fetch\u0027 on the session update to ensure the session is up to date when the update is performed. This may not be necessary so if you think it may have a negative impact I can remove it. All tests passing though so hopefully this is good to go.","commit_id":"0a59bef7342f3cffaa7835ec26d329a78c218c4e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"40ec05588135390f9a17c63d4a2a998b0c678097","unresolved":false,"context_lines":[{"line_number":262,"context_line":""},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"def image_update(context, image_id, values, purge_props\u003dFalse,"},{"line_number":265,"context_line":"                 from_state\u003dNone):"},{"line_number":266,"context_line":"    \"\"\""},{"line_number":267,"context_line":"    Set the given properties on an image and update it."},{"line_number":268,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F84%2Fo%3D","line":265,"updated":"2013-12-19 05:06:33.000000000","message":"I think we need update registry and simple driver also:\n\nhttps://github.com/openstack/glance/blob/master/glance/db/registry/api.py#L70\n\nhttps://github.com/openstack/glance/blob/master/glance/db/simple/api.py#L545","commit_id":"f502d93715a86d376e294bae1cb9967f27f56a01"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"3518e19386fd7cd8f1010981fe9ea09aebf9b447","unresolved":false,"context_lines":[{"line_number":262,"context_line":""},{"line_number":263,"context_line":""},{"line_number":264,"context_line":"def image_update(context, image_id, values, purge_props\u003dFalse,"},{"line_number":265,"context_line":"                 from_state\u003dNone):"},{"line_number":266,"context_line":"    \"\"\""},{"line_number":267,"context_line":"    Set the given properties on an image and update it."},{"line_number":268,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAATn%2F8250%3D","line":265,"in_reply_to":"AAAATn%2F84%2Fo%3D","updated":"2013-12-19 14:27:17.000000000","message":"Done","commit_id":"f502d93715a86d376e294bae1cb9967f27f56a01"}],"glance/registry/api/v1/images.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"7f5b7c330eba9fdf054350326570939af18352e2","unresolved":false,"context_lines":[{"line_number":467,"context_line":"            raise exc.HTTPNotFound(body\u003d\u0027Image not found\u0027,"},{"line_number":468,"context_line":"                                   request\u003dreq,"},{"line_number":469,"context_line":"                                   content_type\u003d\u0027text/plain\u0027)"},{"line_number":470,"context_line":"        except exception.Duplicate as e:"},{"line_number":471,"context_line":"            LOG.info(str(e))"},{"line_number":472,"context_line":"            raise exc.HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":473,"context_line":"                                   request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2FK18%3D","line":470,"updated":"2013-10-22 04:34:07.000000000","message":"exception.Conflict ?","commit_id":"fd45bb430424dd63da2b11c6df8fb4101f3832f2"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"a97efb3e94b7d0e5bf3e1890c8698985e3ade212","unresolved":false,"context_lines":[{"line_number":467,"context_line":"            raise exc.HTTPNotFound(body\u003d\u0027Image not found\u0027,"},{"line_number":468,"context_line":"                                   request\u003dreq,"},{"line_number":469,"context_line":"                                   content_type\u003d\u0027text/plain\u0027)"},{"line_number":470,"context_line":"        except exception.Duplicate as e:"},{"line_number":471,"context_line":"            LOG.info(str(e))"},{"line_number":472,"context_line":"            raise exc.HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":473,"context_line":"                                   request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATX%2F%2F9dE%3D","line":470,"in_reply_to":"AAAATH%2F%2FHkc%3D","updated":"2013-10-23 16:48:55.000000000","message":"We still need this catch to convert glance.common.exception.Conflict to webob.exc.HTTPConflict.","commit_id":"fd45bb430424dd63da2b11c6df8fb4101f3832f2"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"2df8c0e2416b9788774817c6520f236e3fb31d98","unresolved":false,"context_lines":[{"line_number":467,"context_line":"            raise exc.HTTPNotFound(body\u003d\u0027Image not found\u0027,"},{"line_number":468,"context_line":"                                   request\u003dreq,"},{"line_number":469,"context_line":"                                   content_type\u003d\u0027text/plain\u0027)"},{"line_number":470,"context_line":"        except exception.Duplicate as e:"},{"line_number":471,"context_line":"            LOG.info(str(e))"},{"line_number":472,"context_line":"            raise exc.HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":473,"context_line":"                                   request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2FHkc%3D","line":470,"in_reply_to":"AAAATH%2F%2FK18%3D","updated":"2013-10-22 22:24:17.000000000","message":"You are correct that this one is not required since exception.Conflict is caught by the client and converted.","commit_id":"fd45bb430424dd63da2b11c6df8fb4101f3832f2"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"3b43b6bca21c666d841367c385c988a120c8d2ab","unresolved":false,"context_lines":[{"line_number":468,"context_line":"                                   request\u003dreq,"},{"line_number":469,"context_line":"                                   content_type\u003d\u0027text/plain\u0027)"},{"line_number":470,"context_line":"        except exception.Conflict as e:"},{"line_number":471,"context_line":"            LOG.info(str(e))"},{"line_number":472,"context_line":"            raise exc.HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":473,"context_line":"                                   request\u003dreq,"},{"line_number":474,"context_line":"                                   content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2F%2Fag%3D","line":471,"updated":"2013-10-24 06:26:21.000000000","message":"nit: I prefer go unicode way to prevent potential conversion failure: LOG.info(unicode(e))","commit_id":"761808d2c12930ddad9755fa947603e2bd2c54b1"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"c82ddb1cf8673245f2c556f7da454d90fbfebd97","unresolved":false,"context_lines":[{"line_number":468,"context_line":"                                   request\u003dreq,"},{"line_number":469,"context_line":"                                   content_type\u003d\u0027text/plain\u0027)"},{"line_number":470,"context_line":"        except exception.Conflict as e:"},{"line_number":471,"context_line":"            LOG.info(str(e))"},{"line_number":472,"context_line":"            raise exc.HTTPConflict(body\u003d\u0027Image operation conflicts\u0027,"},{"line_number":473,"context_line":"                                   request\u003dreq,"},{"line_number":474,"context_line":"                                   content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2F9Mw%3D","line":471,"in_reply_to":"AAAATn%2F%2F%2Fag%3D","updated":"2013-10-24 16:32:19.000000000","message":"Done","commit_id":"761808d2c12930ddad9755fa947603e2bd2c54b1"}],"glance/tests/unit/v1/test_api.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"3b43b6bca21c666d841367c385c988a120c8d2ab","unresolved":false,"context_lines":[{"line_number":31,"context_line":"from glance.api.v1 import filters"},{"line_number":32,"context_line":"from glance.api.v1 import images"},{"line_number":33,"context_line":"from glance.api.v1 import router"},{"line_number":34,"context_line":"import glance.registry.client.v1.api as registry"},{"line_number":35,"context_line":"from glance.common import exception"},{"line_number":36,"context_line":"import glance.common.config"},{"line_number":37,"context_line":"import glance.context"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2F%2FZ4%3D","line":34,"updated":"2013-10-24 06:26:21.000000000","message":"we keep the order alphabetically .","commit_id":"761808d2c12930ddad9755fa947603e2bd2c54b1"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"c82ddb1cf8673245f2c556f7da454d90fbfebd97","unresolved":false,"context_lines":[{"line_number":31,"context_line":"from glance.api.v1 import filters"},{"line_number":32,"context_line":"from glance.api.v1 import images"},{"line_number":33,"context_line":"from glance.api.v1 import router"},{"line_number":34,"context_line":"import glance.registry.client.v1.api as registry"},{"line_number":35,"context_line":"from glance.common import exception"},{"line_number":36,"context_line":"import glance.common.config"},{"line_number":37,"context_line":"import glance.context"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2F9NM%3D","line":34,"in_reply_to":"AAAATn%2F%2F%2FZ4%3D","updated":"2013-10-24 16:32:19.000000000","message":"Done","commit_id":"761808d2c12930ddad9755fa947603e2bd2c54b1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"3b43b6bca21c666d841367c385c988a120c8d2ab","unresolved":false,"context_lines":[{"line_number":2522,"context_line":"        \"\"\"Clear the test environment\"\"\""},{"line_number":2523,"context_line":"        super(TestAPIProtectedProps, self).tearDown()"},{"line_number":2524,"context_line":"        self.destroy_fixtures()"},{"line_number":2525,"context_line":"        self.stubs.UnsetAll()"},{"line_number":2526,"context_line":""},{"line_number":2527,"context_line":"    def destroy_fixtures(self):"},{"line_number":2528,"context_line":"        # Easiest to just drop the models and re-create them..."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2F%2FZY%3D","line":2525,"updated":"2013-10-24 06:26:21.000000000","message":"base class already did, why we need call again: https://github.com/openstack/glance/blob/master/glance/tests/utils.py#L64","commit_id":"761808d2c12930ddad9755fa947603e2bd2c54b1"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"c82ddb1cf8673245f2c556f7da454d90fbfebd97","unresolved":false,"context_lines":[{"line_number":2522,"context_line":"        \"\"\"Clear the test environment\"\"\""},{"line_number":2523,"context_line":"        super(TestAPIProtectedProps, self).tearDown()"},{"line_number":2524,"context_line":"        self.destroy_fixtures()"},{"line_number":2525,"context_line":"        self.stubs.UnsetAll()"},{"line_number":2526,"context_line":""},{"line_number":2527,"context_line":"    def destroy_fixtures(self):"},{"line_number":2528,"context_line":"        # Easiest to just drop the models and re-create them..."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F%2F9NA%3D","line":2525,"in_reply_to":"AAAATn%2F%2F%2FZY%3D","updated":"2013-10-24 16:32:19.000000000","message":"Done","commit_id":"761808d2c12930ddad9755fa947603e2bd2c54b1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"104b939dfebba024487dbae266b74b551b6109bb","unresolved":false,"context_lines":[{"line_number":993,"context_line":""},{"line_number":994,"context_line":"        def fake_get_image_metadata(*args, **kwargs):"},{"line_number":995,"context_line":"            meta \u003d orig_get_image_metadata(*args, **kwargs)"},{"line_number":996,"context_line":"            meta[\u0027status\u0027] \u003d status.pop()"},{"line_number":997,"context_line":"            return meta"},{"line_number":998,"context_line":""},{"line_number":999,"context_line":"        self.stubs.Set(registry, \u0027get_image_metadata\u0027, fake_get_image_metadata)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2F2vQ%3D","line":996,"updated":"2013-10-27 05:48:50.000000000","message":"According to above Line #989, seems there should has two calls on the \"registry.get_image_metadata()\" in such call sequence. So could you pls explain where are them? and what are  the trigger paths? Simply, why we need pop() two different status result in twice calls? why not return \"saving\" directly? thanks!","commit_id":"f6cc1ac9ce472995bf1121e73a9c1344e9a8c7d9"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"6598ba7b98a52d336a5a29741edc3dd275abdb02","unresolved":false,"context_lines":[{"line_number":993,"context_line":""},{"line_number":994,"context_line":"        def fake_get_image_metadata(*args, **kwargs):"},{"line_number":995,"context_line":"            meta \u003d orig_get_image_metadata(*args, **kwargs)"},{"line_number":996,"context_line":"            meta[\u0027status\u0027] \u003d status.pop()"},{"line_number":997,"context_line":"            return meta"},{"line_number":998,"context_line":""},{"line_number":999,"context_line":"        self.stubs.Set(registry, \u0027get_image_metadata\u0027, fake_get_image_metadata)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F%2FmAg%3D","line":996,"in_reply_to":"AAAATn%2F%2F2vQ%3D","updated":"2013-10-31 17:51:31.000000000","message":"The first call to get_image_metadata() needs to return \u0027queued\u0027 so that we get past the first check. Then we want it to return \u0027saving\u0027 so that we can test our new barrier.","commit_id":"f6cc1ac9ce472995bf1121e73a9c1344e9a8c7d9"}]}
