)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9520,"name":"David Koo (koofoss)","email":"david.koo@huawei.com","username":"koofoss"},"change_message_id":"de63f2ba7a1422a4b8a4d53c1a9ff77f95aa77d5","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Co-authored-by: Hirofumi Ichihara \u003cichihara.hirofumi@lab.ntt.co.jp\u003e"},{"line_number":15,"context_line":"Change-Id: I5552220ce264c0d09780bbd0eb7610e7cff0b820"},{"line_number":16,"context_line":"Fixes: bug 1236868"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAT3%2F%2F20I%3D","line":16,"updated":"2013-12-30 08:19:40.000000000","message":"Nit: should be \"Fixes bug: 1236868\"\n\nIn the current form the link generated in Gerrit leads to a (non-existent) local review URL, not the launchpad bug.","commit_id":"e919c9c647d58c229f90db2ac06f312a0c4dfd51"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"599e3e23db72ea0b99c3d5648814aabbfc410eb3","unresolved":false,"context_lines":[{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Co-authored-by: Hirofumi Ichihara \u003cichihara.hirofumi@lab.ntt.co.jp\u003e"},{"line_number":15,"context_line":"Change-Id: I5552220ce264c0d09780bbd0eb7610e7cff0b820"},{"line_number":16,"context_line":"Fixes: bug 1236868"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAAUH%2F%2BxVE%3D","line":16,"in_reply_to":"AAAAT3%2F%2F20I%3D","updated":"2014-01-22 11:49:44.000000000","message":"Actually the convention is now \"Closes-Bug: ...\" as per https://wiki.openstack.org/wiki/Gerrit_Workflow so I\u0027ll change this.","commit_id":"e919c9c647d58c229f90db2ac06f312a0c4dfd51"}],"glance/api/v1/images.py":[{"author":{"_account_id":8443,"name":"Georgy Okrokvertskhov","email":"gokrokvertskhov@mirantis.com","username":"gokrokvertskhov"},"change_message_id":"ea436a336c3be60314fc7d995c473edbb39f4fec","unresolved":false,"context_lines":[{"line_number":646,"context_line":"                LOG.debug(\"duplicate operation - deleting image data for \""},{"line_number":647,"context_line":"                          \" %(id)s (location:%(location)s)\" %"},{"line_number":648,"context_line":"                          {\u0027id\u0027: image_id, \u0027location\u0027: image_meta[\u0027location\u0027]})"},{"line_number":649,"context_line":"                upload_utils.initiate_deletion(req, location_data, image_id)"},{"line_number":650,"context_line":"        except exception.Invalid as e:"},{"line_number":651,"context_line":"            msg \u003d (\"Failed to activate image. Got error: %s\" %"},{"line_number":652,"context_line":"                   utils.exception_to_str(e))"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_89edf7ba","line":649,"updated":"2014-07-24 23:01:17.000000000","message":"want to highlight that image_meta[\u0027location\u0027] and location_data technically have different types. The first one is an array created on line 631 and local_data is most probably scalar. I am not sure why image_meta[\u0027location\u0027] argument was replaced by local_data. Even in previous line image_meta is logged rather then location_data. It looks like that it is better to keep this consistent and return image_meta[\u0027location\u0027] back to initialize_deletion call.","commit_id":"1150fd7085ba9deb3bcde309775cc59121aae3f8"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"92b63fa7752be7190bf4297f638b305dcb5ef8da","unresolved":false,"context_lines":[{"line_number":646,"context_line":"                LOG.debug(\"duplicate operation - deleting image data for \""},{"line_number":647,"context_line":"                          \" %(id)s (location:%(location)s)\" %"},{"line_number":648,"context_line":"                          {\u0027id\u0027: image_id, \u0027location\u0027: image_meta[\u0027location\u0027]})"},{"line_number":649,"context_line":"                upload_utils.initiate_deletion(req, location_data, image_id)"},{"line_number":650,"context_line":"        except exception.Invalid as e:"},{"line_number":651,"context_line":"            msg \u003d (\"Failed to activate image. Got error: %s\" %"},{"line_number":652,"context_line":"                   utils.exception_to_str(e))"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_8b3b0b9b","line":649,"in_reply_to":"baada198_89edf7ba","updated":"2014-07-25 18:42:35.000000000","message":"Georgy,\n\nThis change is fixing an issue introduced by commit 66d24bb1 which was left unnoticed because unit tests were not reaching it. My unit does reach this point hence why i discovered it. Take a look at how initiate_delete was called prior to and after 66d24bb1.","commit_id":"1150fd7085ba9deb3bcde309775cc59121aae3f8"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"960e91892760ea469f6e5933211fdfb7d2732f7b","unresolved":false,"context_lines":[{"line_number":646,"context_line":"                LOG.debug(\"duplicate operation - deleting image data for \""},{"line_number":647,"context_line":"                          \" %(id)s (location:%(location)s)\" %"},{"line_number":648,"context_line":"                          {\u0027id\u0027: image_id, \u0027location\u0027: image_meta[\u0027location\u0027]})"},{"line_number":649,"context_line":"                upload_utils.initiate_deletion(req, location_data, image_id)"},{"line_number":650,"context_line":"        except exception.Invalid as e:"},{"line_number":651,"context_line":"            msg \u003d (\"Failed to activate image. Got error: %s\" %"},{"line_number":652,"context_line":"                   utils.exception_to_str(e))"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_824ae9aa","line":649,"in_reply_to":"baada198_8b3b0b9b","updated":"2014-07-28 11:23:00.000000000","message":"@dosaboy, yep, good catch!","commit_id":"1150fd7085ba9deb3bcde309775cc59121aae3f8"}],"glance/api/v1/upload_utils.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"cddd8578ea8477d7da8c6f9dac4a7642724707f9","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    which would stop the registry from raising NotFound (see lp1236868)."},{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    _meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":58,"context_line":"    if _meta[\u0027status\u0027] \u003d\u003d \u0027deleted\u0027:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027deleted\u0027 so aborting update\")"},{"line_number":60,"context_line":"        LOG.info(msg)"},{"line_number":61,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2Fy%2Bs%3D","line":58,"updated":"2013-10-09 17:50:15.000000000","message":"if _meta[\u0027status\u0027] in [\u0027deleted\u0027, \u0027pending_delete\u0027]","commit_id":"9d13a706d0f0f4ae396437d01229dd3ae47aff81"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"3b6ff6e516b080c8d400447fdceb03864fb853c8","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    which would stop the registry from raising NotFound (see lp1236868)."},{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    _meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":58,"context_line":"    if _meta[\u0027status\u0027] \u003d\u003d \u0027deleted\u0027:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027deleted\u0027 so aborting update\")"},{"line_number":60,"context_line":"        LOG.info(msg)"},{"line_number":61,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2FyG8%3D","line":58,"in_reply_to":"AAAATH%2F%2Fy%2Bs%3D","updated":"2013-10-09 21:18:48.000000000","message":"Done","commit_id":"9d13a706d0f0f4ae396437d01229dd3ae47aff81"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"cddd8578ea8477d7da8c6f9dac4a7642724707f9","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    _meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":58,"context_line":"    if _meta[\u0027status\u0027] \u003d\u003d \u0027deleted\u0027:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027deleted\u0027 so aborting update\")"},{"line_number":60,"context_line":"        LOG.info(msg)"},{"line_number":61,"context_line":"        raise exception.NotFound(msg)"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2Fy%2Bc%3D","line":59,"updated":"2013-10-09 17:50:15.000000000","message":"msg \u003d _(\"image status is \u0027%s\u0027 so aborting update.\") % _meta[\u0027status\u0027]","commit_id":"9d13a706d0f0f4ae396437d01229dd3ae47aff81"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"3b6ff6e516b080c8d400447fdceb03864fb853c8","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    _meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":58,"context_line":"    if _meta[\u0027status\u0027] \u003d\u003d \u0027deleted\u0027:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027deleted\u0027 so aborting update\")"},{"line_number":60,"context_line":"        LOG.info(msg)"},{"line_number":61,"context_line":"        raise exception.NotFound(msg)"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2FyHE%3D","line":59,"in_reply_to":"AAAATH%2F%2Fy%2Bc%3D","updated":"2013-10-09 21:18:48.000000000","message":"Done","commit_id":"9d13a706d0f0f4ae396437d01229dd3ae47aff81"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"cddd8578ea8477d7da8c6f9dac4a7642724707f9","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    _meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":58,"context_line":"    if _meta[\u0027status\u0027] \u003d\u003d \u0027deleted\u0027:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027deleted\u0027 so aborting update\")"},{"line_number":60,"context_line":"        LOG.info(msg)"},{"line_number":61,"context_line":"        raise exception.NotFound(msg)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    return registry.update_image_metadata(context, image_id, image_meta)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2Fy%2BI%3D","line":60,"updated":"2013-10-09 17:50:15.000000000","message":"I prefer write a \u0027warn\u0027 level log at here.","commit_id":"9d13a706d0f0f4ae396437d01229dd3ae47aff81"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"3b6ff6e516b080c8d400447fdceb03864fb853c8","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    _meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":58,"context_line":"    if _meta[\u0027status\u0027] \u003d\u003d \u0027deleted\u0027:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027deleted\u0027 so aborting update\")"},{"line_number":60,"context_line":"        LOG.info(msg)"},{"line_number":61,"context_line":"        raise exception.NotFound(msg)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    return registry.update_image_metadata(context, image_id, image_meta)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATH%2F%2FyGs%3D","line":60,"in_reply_to":"AAAATH%2F%2Fy%2BI%3D","updated":"2013-10-09 21:18:48.000000000","message":"I disagree. A warning is normally to indicate on non-critical error has occured. This does not apply here since we simply safeguarding against a potential race condition. Info should be sufficient.","commit_id":"9d13a706d0f0f4ae396437d01229dd3ae47aff81"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"b217f427ddf88cdc6b290ea8986600472ea6c15b","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    _meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":58,"context_line":"    if _meta[\u0027status\u0027] in [\u0027deleted\u0027, \u0027pending_delete\u0027]:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027%s\u0027 so aborting update\") % (_meta[\u0027status\u0027])"},{"line_number":60,"context_line":"        LOG.info(msg)"},{"line_number":61,"context_line":"        raise exception.NotFound(msg)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    return registry.update_image_metadata(context, image_id, image_meta)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATH%2F%2Fdn4%3D","line":60,"updated":"2013-10-15 21:30:38.000000000","message":"should this be a warn?","commit_id":"cfdcad6cf3e78159bb59d215d40a2f5c6e146c9e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c1b7212eb5e193235c590d264aaf42eeb64d601b","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    _meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":58,"context_line":"    if _meta[\u0027status\u0027] in [\u0027deleted\u0027, \u0027pending_delete\u0027]:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027%s\u0027 so aborting update\") % (_meta[\u0027status\u0027])"},{"line_number":60,"context_line":"        LOG.info(msg)"},{"line_number":61,"context_line":"        raise exception.NotFound(msg)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    return registry.update_image_metadata(context, image_id, image_meta)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATH%2F%2Fcj4%3D","line":60,"in_reply_to":"AAAATH%2F%2Fdn4%3D","updated":"2013-10-16 02:37:38.000000000","message":"same comments as mine in PS 4.","commit_id":"cfdcad6cf3e78159bb59d215d40a2f5c6e146c9e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"465bdbf4f8600a8969d8f13b6409f6e59aeefbbb","unresolved":false,"context_lines":[{"line_number":169,"context_line":"            #"},{"line_number":170,"context_line":"            # We get \"location\" from above call to store.add(), any"},{"line_number":171,"context_line":"            # exceptions that occur there handle this same issue internally,"},{"line_number":172,"context_line":"            # Since this is store-agnostic, should apply to all stores."},{"line_number":173,"context_line":"            initiate_deletion(req, location, image_id, CONF.delayed_delete)"},{"line_number":174,"context_line":"            raise webob.exc.HTTPPreconditionFailed(explanation\u003dmsg,"},{"line_number":175,"context_line":"                                                   request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATH%2F%2FwRs%3D","line":172,"updated":"2013-10-10 10:04:38.000000000","message":"I\u0027m thinking do we still need this calling for removing partial uploaded image bits? if we have [1][2]. there is a related question at Line #141, if we can remove this call then we can improve a little performance (since it will involve store.delete()).\n\nany thoughts?\n\n[1]https://bugs.launchpad.net/glance/+bug/1226013\n\n[2]https://bugs.launchpad.net/glance/+bug/1214276","commit_id":"cfdcad6cf3e78159bb59d215d40a2f5c6e146c9e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c1b7212eb5e193235c590d264aaf42eeb64d601b","unresolved":false,"context_lines":[{"line_number":169,"context_line":"            #"},{"line_number":170,"context_line":"            # We get \"location\" from above call to store.add(), any"},{"line_number":171,"context_line":"            # exceptions that occur there handle this same issue internally,"},{"line_number":172,"context_line":"            # Since this is store-agnostic, should apply to all stores."},{"line_number":173,"context_line":"            initiate_deletion(req, location, image_id, CONF.delayed_delete)"},{"line_number":174,"context_line":"            raise webob.exc.HTTPPreconditionFailed(explanation\u003dmsg,"},{"line_number":175,"context_line":"                                                   request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATH%2F%2FckU%3D","line":172,"in_reply_to":"AAAATH%2F%2Fdj0%3D","updated":"2013-10-16 02:37:38.000000000","message":"Hi iccha\n\n1. you are right, 141 is different. thanks for point it out.\n2. OK, we can keep this call at here to prevent potential bits leak.","commit_id":"cfdcad6cf3e78159bb59d215d40a2f5c6e146c9e"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"b217f427ddf88cdc6b290ea8986600472ea6c15b","unresolved":false,"context_lines":[{"line_number":169,"context_line":"            #"},{"line_number":170,"context_line":"            # We get \"location\" from above call to store.add(), any"},{"line_number":171,"context_line":"            # exceptions that occur there handle this same issue internally,"},{"line_number":172,"context_line":"            # Since this is store-agnostic, should apply to all stores."},{"line_number":173,"context_line":"            initiate_deletion(req, location, image_id, CONF.delayed_delete)"},{"line_number":174,"context_line":"            raise webob.exc.HTTPPreconditionFailed(explanation\u003dmsg,"},{"line_number":175,"context_line":"                                                   request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATH%2F%2Fdj0%3D","line":172,"in_reply_to":"AAAATH%2F%2FwRs%3D","updated":"2013-10-15 21:30:38.000000000","message":"Zhi 141 does delete if there is mismatch between what user supplied and what swift uploads. I am not sure if that is the same as this. Here we are \nable to pin point that issue and raise specific PreconditionFailed exception.\n\n[1] is for v2\n[2] is for error occurring during an upload.\n\n[2] might sometimes result because of the delete, but not sure. So i think it is still good to have it in there.","commit_id":"cfdcad6cf3e78159bb59d215d40a2f5c6e146c9e"},{"author":{"_account_id":6493,"name":"John Bresnahan","email":"john@bresnahan.me","username":"jbresnah"},"change_message_id":"71d90f7f145d8a1db0512925cefcf4023efe4667","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    which would stop the registry from raising NotFound (see lp1236868)."},{"line_number":56,"context_line":"    \"\"\""},{"line_number":57,"context_line":"    _meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":58,"context_line":"    if _meta[\u0027status\u0027] in [\u0027deleted\u0027, \u0027pending_delete\u0027]:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027%s\u0027 so aborting update\") % (_meta[\u0027status\u0027])"},{"line_number":60,"context_line":"        LOG.info(msg)"},{"line_number":61,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAATn%2F90Jk%3D","line":58,"updated":"2013-12-05 16:31:11.000000000","message":"I so very long for a single place in glance where all state transitions/validations are made.  But because we are quite far from that I will not object here.","commit_id":"16434973d07eb0464e1f9362abe3da3461725c64"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"ac4d9a7f16f7739a3389f73c4259b3b12e6a4f53","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    :param image_id: Opaque image identifier"},{"line_number":54,"context_line":"    \"\"\""},{"line_number":55,"context_line":"    registry.update_image_metadata(req.context, image_id,"},{"line_number":56,"context_line":"                                   {\u0027status\u0027: \u0027killed\u0027})"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"def safe_kill(req, image_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Fu2I%3D","side":"PARENT","line":56,"updated":"2014-02-11 06:33:53.000000000","message":"Same comment here, I think we only intend to call _kill from the saving state.","commit_id":"35bf0af69cc128f7878339c9904f9af487e8df8c"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"85c2b0b42d6514c95c12280a2c0804baf16efd89","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    :param image_id: Opaque image identifier"},{"line_number":54,"context_line":"    \"\"\""},{"line_number":55,"context_line":"    registry.update_image_metadata(req.context, image_id,"},{"line_number":56,"context_line":"                                   {\u0027status\u0027: \u0027killed\u0027})"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"def safe_kill(req, image_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_a448f25c","side":"PARENT","line":56,"in_reply_to":"AAAAUX%2F%2Fu2I%3D","updated":"2014-07-21 11:18:50.000000000","message":"About to upload new patchset. It is actually possible to kill from \u0027queued\u0027 or \u0027saving\u0027. I have adapted the from_state logic to allow for \u003e state.","commit_id":"35bf0af69cc128f7878339c9904f9af487e8df8c"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"ac4d9a7f16f7739a3389f73c4259b3b12e6a4f53","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        try:"},{"line_number":144,"context_line":"            image_meta \u003d registry.update_image_metadata(req.context,"},{"line_number":145,"context_line":"                                                        image_id,"},{"line_number":146,"context_line":"                                                        update_data)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        except exception.NotFound as e:"},{"line_number":149,"context_line":"            msg \u003d _(\"Image %s could not be found after upload. The image may \""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2Fu4Q%3D","side":"PARENT","line":146,"updated":"2014-02-11 06:33:53.000000000","message":"It just seems like all you need is to add from_state\u003d\u0027saving\u0027 here. I would really prefer it that way unless there is some difficulty I\u0027m just not understanding.","commit_id":"35bf0af69cc128f7878339c9904f9af487e8df8c"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1ae4561f0e9fa4336ad7e50a885f35d4c0153bf3","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        try:"},{"line_number":144,"context_line":"            image_meta \u003d registry.update_image_metadata(req.context,"},{"line_number":145,"context_line":"                                                        image_id,"},{"line_number":146,"context_line":"                                                        update_data)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        except exception.NotFound as e:"},{"line_number":149,"context_line":"            msg \u003d _(\"Image %s could not be found after upload. The image may \""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2BcJ8%3D","side":"PARENT","line":146,"in_reply_to":"AAAAUX%2F%2FhMI%3D","updated":"2014-02-21 06:36:07.000000000","message":"Agreed to go this way Mark proposed, even I think current patch/solution is worked for this issue. Probably this approach is more consistent with others code segments those already in the codebase (e.g. db driver, registry api).","commit_id":"35bf0af69cc128f7878339c9904f9af487e8df8c"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"85c2b0b42d6514c95c12280a2c0804baf16efd89","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        try:"},{"line_number":144,"context_line":"            image_meta \u003d registry.update_image_metadata(req.context,"},{"line_number":145,"context_line":"                                                        image_id,"},{"line_number":146,"context_line":"                                                        update_data)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        except exception.NotFound as e:"},{"line_number":149,"context_line":"            msg \u003d _(\"Image %s could not be found after upload. The image may \""}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_e4758a98","side":"PARENT","line":146,"in_reply_to":"AAAAUX%2F%2Fu4Q%3D","updated":"2014-07-21 11:18:50.000000000","message":"Done","commit_id":"35bf0af69cc128f7878339c9904f9af487e8df8c"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"94ddc41891f0c7b36f9d5adcaf7422bd330c9658","unresolved":false,"context_lines":[{"line_number":143,"context_line":"        try:"},{"line_number":144,"context_line":"            image_meta \u003d registry.update_image_metadata(req.context,"},{"line_number":145,"context_line":"                                                        image_id,"},{"line_number":146,"context_line":"                                                        update_data)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        except exception.NotFound as e:"},{"line_number":149,"context_line":"            msg \u003d _(\"Image %s could not be found after upload. The image may \""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2FhMI%3D","side":"PARENT","line":146,"in_reply_to":"AAAAUX%2F%2Fu4Q%3D","updated":"2014-02-12 16:32:59.000000000","message":"So i agree that this should work but I just tried doing this here and above and it breaks a whole load of functional tests. I have not looked into why yet.","commit_id":"35bf0af69cc128f7878339c9904f9af487e8df8c"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"b36132a13280c03a9754362f6a9307f52855e704","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    This covers the case of an admin context that has show_deleted\u003dTrue"},{"line_number":54,"context_line":"    which would stop the registry from raising NotFound (see lp1236868)."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    current_meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":57,"context_line":"    current_status \u003d current_meta[\u0027status\u0027]"},{"line_number":58,"context_line":"    if current_status in [\u0027deleted\u0027, \u0027pending_delete\u0027]:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027%s\u0027 so aborting update\") % (current_status)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F9lIQ%3D","line":56,"updated":"2014-02-05 22:10:33.000000000","message":"If we could safely assume that we should only transfer to the \u0027killed\u0027 state from the \u0027saving\u0027 state, we could save the extra registry / db lookup.\n\nIs it not safe to make that assumption?","commit_id":"a840e0094f752acfc76cb4518fbc338b7d224d40"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"750122f63f3216d05e9744d7f86a3956f2420e90","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    This covers the case of an admin context that has show_deleted\u003dTrue"},{"line_number":54,"context_line":"    which would stop the registry from raising NotFound (see lp1236868)."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    current_meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":57,"context_line":"    current_status \u003d current_meta[\u0027status\u0027]"},{"line_number":58,"context_line":"    if current_status in [\u0027deleted\u0027, \u0027pending_delete\u0027]:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027%s\u0027 so aborting update\") % (current_status)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2F9w8%3D","line":56,"in_reply_to":"AAAAUH%2F9lIQ%3D","updated":"2014-02-08 06:51:10.000000000","message":"+1, outside we have already updated the \"saving\" status to image where in v1 controller, so seems it\u0027s a safe assumption here.","commit_id":"a840e0094f752acfc76cb4518fbc338b7d224d40"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"22dcbd50d62c88c7a8d2ee58576b153cfec88497","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    This covers the case of an admin context that has show_deleted\u003dTrue"},{"line_number":54,"context_line":"    which would stop the registry from raising NotFound (see lp1236868)."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    current_meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":57,"context_line":"    current_status \u003d current_meta[\u0027status\u0027]"},{"line_number":58,"context_line":"    if current_status in [\u0027deleted\u0027, \u0027pending_delete\u0027]:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027%s\u0027 so aborting update\") % (current_status)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2F2t0%3D","line":56,"in_reply_to":"AAAAUH%2F9lIQ%3D","updated":"2014-02-10 12:07:29.000000000","message":"Mark, if we mandate \u0027saving\u0027-\u003e\u0027killed\u0027 we would get a Conflict in every case where the status is not \u0027saving\u0027. My understanding was that if the status is already \u0027deleted\u0027 or \u0027pending_delete\u0027 we should return NotFound hence why we need this prior lookup. Having said that, the image could go to \u0027deleted\u0027/\u0027pending_delete\u0027 between this query and the update so it is not watertight but we would get a Conflict in that case. Does that make sense?","commit_id":"a840e0094f752acfc76cb4518fbc338b7d224d40"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"85c2b0b42d6514c95c12280a2c0804baf16efd89","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    This covers the case of an admin context that has show_deleted\u003dTrue"},{"line_number":54,"context_line":"    which would stop the registry from raising NotFound (see lp1236868)."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    current_meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":57,"context_line":"    current_status \u003d current_meta[\u0027status\u0027]"},{"line_number":58,"context_line":"    if current_status in [\u0027deleted\u0027, \u0027pending_delete\u0027]:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027%s\u0027 so aborting update\") % (current_status)"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_a4b6323c","line":56,"in_reply_to":"AAAAUH%2F9lIQ%3D","updated":"2014-07-21 11:18:50.000000000","message":"Ok i\u0027ve adapted the code so that we no longer need this lookup. \u0027queued\u0027-\u003e\u0027killed\u0027 and \u0027saving\u0027-\u003e\u0027killed\u0027 are apparently both valid transitions. See new patchset and comment for explanation.","commit_id":"a840e0094f752acfc76cb4518fbc338b7d224d40"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"75dc5745a4db1637f160e49a7683ecb7b80b80ed","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    This covers the case of an admin context that has show_deleted\u003dTrue"},{"line_number":54,"context_line":"    which would stop the registry from raising NotFound (see lp1236868)."},{"line_number":55,"context_line":"    \"\"\""},{"line_number":56,"context_line":"    current_meta \u003d registry.get_image_metadata(context, image_id)"},{"line_number":57,"context_line":"    current_status \u003d current_meta[\u0027status\u0027]"},{"line_number":58,"context_line":"    if current_status in [\u0027deleted\u0027, \u0027pending_delete\u0027]:"},{"line_number":59,"context_line":"        msg \u003d _(\"image status is \u0027%s\u0027 so aborting update\") % (current_status)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUX%2F%2F1SA%3D","line":56,"in_reply_to":"AAAAUX%2F%2F2t0%3D","updated":"2014-02-10 14:40:34.000000000","message":"Oh forgot the concurrent context, which just is what we try to resolve, withdraw my above comment sorry.","commit_id":"a840e0094f752acfc76cb4518fbc338b7d224d40"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"34336a7ab5c47ad2b9a971f7140289a286462cad","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    # needs updating to reflect the fact that queued-\u003ekilled and saving-\u003ekilled"},{"line_number":57,"context_line":"    # are both allowed."},{"line_number":58,"context_line":"    registry.update_image_metadata(req.context, image_id,"},{"line_number":59,"context_line":"                                   {\u0027status\u0027: \u0027killed\u0027},"},{"line_number":60,"context_line":"                                   from_state\u003dfrom_state)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_167d2db2","line":59,"updated":"2014-07-28 15:24:42.000000000","message":"wondering if we should have a private method here to determine if image status transition is valid or not and then log success or failure depending on the kind of request. \n\nOne advantage of this is to have logstash run and look for the appropriate status transitioning and say how many images went to active from saving or went to killed/delete ...","commit_id":"d773b6afdc8d4d76fae951c0d10ec0327ab420fd"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5e87786ef69fc8c95a14c92f5d93055de265a1e2","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    # needs updating to reflect the fact that queued-\u003ekilled and saving-\u003ekilled"},{"line_number":57,"context_line":"    # are both allowed."},{"line_number":58,"context_line":"    registry.update_image_metadata(req.context, image_id,"},{"line_number":59,"context_line":"                                   {\u0027status\u0027: \u0027killed\u0027},"},{"line_number":60,"context_line":"                                   from_state\u003dfrom_state)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_29fad6b9","line":59,"in_reply_to":"baada198_167d2db2","updated":"2014-07-28 15:36:16.000000000","message":"I think the original approach of the fix for this bug is similar with your idea: https://review.openstack.org/#/c/50457/10/glance/api/v1/upload_utils.py\n\nbtw, I still think we need a discussion for getting a complete solution on image states management.","commit_id":"d773b6afdc8d4d76fae951c0d10ec0327ab420fd"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"a05eb3bfd718e7b3ebf237736ad7890b3a64dbc0","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    # needs updating to reflect the fact that queued-\u003ekilled and saving-\u003ekilled"},{"line_number":57,"context_line":"    # are both allowed."},{"line_number":58,"context_line":"    registry.update_image_metadata(req.context, image_id,"},{"line_number":59,"context_line":"                                   {\u0027status\u0027: \u0027killed\u0027},"},{"line_number":60,"context_line":"                                   from_state\u003dfrom_state)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_69612ea7","line":59,"in_reply_to":"baada198_167d2db2","updated":"2014-07-28 15:32:56.000000000","message":"Nikhil, state transition validation is now done in the db api under lock-and-key to avoid any race conditions arising from other concurrent requests. We have already been through a number of iterations where we have tried different means of validation and the idea of having a query here to check status was rejected since (a) it does not protect against races (state could change after query but before update) and (b) it would incur a performance hit for the extra query on each request.","commit_id":"d773b6afdc8d4d76fae951c0d10ec0327ab420fd"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"3bf8bf06c8bb40abb6132fd0033aa08159ad819c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    # needs updating to reflect the fact that queued-\u003ekilled and saving-\u003ekilled"},{"line_number":57,"context_line":"    # are both allowed."},{"line_number":58,"context_line":"    registry.update_image_metadata(req.context, image_id,"},{"line_number":59,"context_line":"                                   {\u0027status\u0027: \u0027killed\u0027},"},{"line_number":60,"context_line":"                                   from_state\u003dfrom_state)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_184c6f3e","line":59,"in_reply_to":"baada198_1e4c5f3e","updated":"2014-07-28 20:43:51.000000000","message":"Nikhil, support for the from_state logic was added in commit 51ecc801. I will add a comment to explain the use of from_state.","commit_id":"d773b6afdc8d4d76fae951c0d10ec0327ab420fd"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"8c132c81bdaa0ae0c409b10cfeda0d6e55a63539","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    # needs updating to reflect the fact that queued-\u003ekilled and saving-\u003ekilled"},{"line_number":57,"context_line":"    # are both allowed."},{"line_number":58,"context_line":"    registry.update_image_metadata(req.context, image_id,"},{"line_number":59,"context_line":"                                   {\u0027status\u0027: \u0027killed\u0027},"},{"line_number":60,"context_line":"                                   from_state\u003dfrom_state)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"baada198_1e4c5f3e","line":59,"in_reply_to":"baada198_29fad6b9","updated":"2014-07-28 18:12:23.000000000","message":"Ok, that makes sense. And, this conversation is definitely out of scope here. \n\nHowever, having a log line for this new \u0027from_state\u0027 addition would really help :)\n\n..something that helps to identify from logs that particular image \u0027image_id\u0027 is being moved into state \u0027final\u0027 from state \u0027current\u0027 ?","commit_id":"d773b6afdc8d4d76fae951c0d10ec0327ab420fd"}],"glance/common/client.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b42d737da974ba32d1d10200906bfb7289212cc0","unresolved":false,"context_lines":[{"line_number":544,"context_line":"                                                 body\u003dres.read())"},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"        except (socket.error, IOError) as e:"},{"line_number":547,"context_line":"            raise exception.ClientConnectionError()"},{"line_number":548,"context_line":""},{"line_number":549,"context_line":"    def _seekable(self, body):"},{"line_number":550,"context_line":"        # pipes are not seekable, avoids sendfile() failure on e.g."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATH%2F%2F19Q%3D","line":547,"updated":"2013-10-09 04:19:56.000000000","message":"1. is this a related change for this patch? i don\u0027t think it is.\n\n2. please remove \u0027 as e\u0027 from Line 546.","commit_id":"734a21ef83f487e225813f85fffacfef83b71687"}],"glance/tests/unit/v1/test_api.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"0f686af8995653ca1d687c6d225f30b36c65fbbe","unresolved":false,"context_lines":[{"line_number":1011,"context_line":"        self.assertEqual(\"active\", res.headers[\u0027x-image-meta-status\u0027])"},{"line_number":1012,"context_line":""},{"line_number":1013,"context_line":"    def _verify_image_status(self, image_id, status, check_deleted\u003dFalse):"},{"line_number":1014,"context_line":"        # Verify the status is deleted"},{"line_number":1015,"context_line":"        req \u003d webob.Request.blank(\"/images/%s\" % image_id)"},{"line_number":1016,"context_line":"        req.method \u003d \u0027HEAD\u0027"},{"line_number":1017,"context_line":"        res \u003d req.get_response(self.api)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F95JI%3D","line":1014,"updated":"2013-12-04 19:54:16.000000000","message":"Oh, for a while I got the feeling if we are deleting the status itself! (Not that we ever do it)\n\nCan you please put deleted in quotes? - \u0027deleted\u0027","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"e641705d2dbdf87b2de0f99d1d6edd54800a35e3","unresolved":false,"context_lines":[{"line_number":1011,"context_line":"        self.assertEqual(\"active\", res.headers[\u0027x-image-meta-status\u0027])"},{"line_number":1012,"context_line":""},{"line_number":1013,"context_line":"    def _verify_image_status(self, image_id, status, check_deleted\u003dFalse):"},{"line_number":1014,"context_line":"        # Verify the status is deleted"},{"line_number":1015,"context_line":"        req \u003d webob.Request.blank(\"/images/%s\" % image_id)"},{"line_number":1016,"context_line":"        req.method \u003d \u0027HEAD\u0027"},{"line_number":1017,"context_line":"        res \u003d req.get_response(self.api)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F91d8%3D","line":1014,"in_reply_to":"AAAATn%2F95JI%3D","updated":"2013-12-05 12:46:08.000000000","message":"Done","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"0f686af8995653ca1d687c6d225f30b36c65fbbe","unresolved":false,"context_lines":[{"line_number":1034,"context_line":""},{"line_number":1035,"context_line":"        res \u003d req.get_response(self.api)"},{"line_number":1036,"context_line":"        self.assertEquals(res.status_int, 201)"},{"line_number":1037,"context_line":"        res_body \u003d json.loads(res.body)[\u0027image\u0027]"},{"line_number":1038,"context_line":""},{"line_number":1039,"context_line":"        self.assertTrue(\u0027id\u0027 in res_body)"},{"line_number":1040,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F95KM%3D","line":1037,"updated":"2013-12-04 19:54:16.000000000","message":"If you happen to post another PS for this MP, please try to use glance.openstack.common.jsonutils","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"e641705d2dbdf87b2de0f99d1d6edd54800a35e3","unresolved":false,"context_lines":[{"line_number":1034,"context_line":""},{"line_number":1035,"context_line":"        res \u003d req.get_response(self.api)"},{"line_number":1036,"context_line":"        self.assertEquals(res.status_int, 201)"},{"line_number":1037,"context_line":"        res_body \u003d json.loads(res.body)[\u0027image\u0027]"},{"line_number":1038,"context_line":""},{"line_number":1039,"context_line":"        self.assertTrue(\u0027id\u0027 in res_body)"},{"line_number":1040,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F91ds%3D","line":1037,"in_reply_to":"AAAATn%2F95KM%3D","updated":"2013-12-05 12:46:08.000000000","message":"In the interest of keeping consistent with the rest of the unit tests i would like leave as it is since there are many tests in that file that use the same json lib. We can create a new bug to cleanup the test if necessary.","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"0f686af8995653ca1d687c6d225f30b36c65fbbe","unresolved":false,"context_lines":[{"line_number":1041,"context_line":"        image_id \u003d res_body[\u0027id\u0027]"},{"line_number":1042,"context_line":"        self.assertTrue(\u0027/images/%s\u0027 % image_id in res.headers[\u0027location\u0027])"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"        # Verify the status is queued"},{"line_number":1045,"context_line":"        self.assertTrue(\u0027status\u0027 in res_body)"},{"line_number":1046,"context_line":"        self.assertEqual(\u0027queued\u0027, res_body[\u0027status\u0027])"},{"line_number":1047,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F95H4%3D","line":1044,"updated":"2013-12-04 19:54:16.000000000","message":"ditto","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"e641705d2dbdf87b2de0f99d1d6edd54800a35e3","unresolved":false,"context_lines":[{"line_number":1041,"context_line":"        image_id \u003d res_body[\u0027id\u0027]"},{"line_number":1042,"context_line":"        self.assertTrue(\u0027/images/%s\u0027 % image_id in res.headers[\u0027location\u0027])"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"        # Verify the status is queued"},{"line_number":1045,"context_line":"        self.assertTrue(\u0027status\u0027 in res_body)"},{"line_number":1046,"context_line":"        self.assertEqual(\u0027queued\u0027, res_body[\u0027status\u0027])"},{"line_number":1047,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F91eI%3D","line":1044,"in_reply_to":"AAAATn%2F95H4%3D","updated":"2013-12-05 12:46:08.000000000","message":"Done","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"0f686af8995653ca1d687c6d225f30b36c65fbbe","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        image_id \u003d res_body[\u0027id\u0027]"},{"line_number":1087,"context_line":"        self.assertTrue(\u0027/images/%s\u0027 % image_id in res.headers[\u0027location\u0027])"},{"line_number":1088,"context_line":""},{"line_number":1089,"context_line":"        # Verify the status is queued"},{"line_number":1090,"context_line":"        self.assertTrue(\u0027status\u0027 in res_body)"},{"line_number":1091,"context_line":"        self.assertEqual(\u0027queued\u0027, res_body[\u0027status\u0027])"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F95Hk%3D","line":1089,"updated":"2013-12-04 19:54:16.000000000","message":"ditto","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"e641705d2dbdf87b2de0f99d1d6edd54800a35e3","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"        image_id \u003d res_body[\u0027id\u0027]"},{"line_number":1087,"context_line":"        self.assertTrue(\u0027/images/%s\u0027 % image_id in res.headers[\u0027location\u0027])"},{"line_number":1088,"context_line":""},{"line_number":1089,"context_line":"        # Verify the status is queued"},{"line_number":1090,"context_line":"        self.assertTrue(\u0027status\u0027 in res_body)"},{"line_number":1091,"context_line":"        self.assertEqual(\u0027queued\u0027, res_body[\u0027status\u0027])"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F91eA%3D","line":1089,"in_reply_to":"AAAATn%2F95Hk%3D","updated":"2013-12-05 12:46:08.000000000","message":"Done","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":9520,"name":"David Koo (koofoss)","email":"david.koo@huawei.com","username":"koofoss"},"change_message_id":"de63f2ba7a1422a4b8a4d53c1a9ff77f95aa77d5","unresolved":false,"context_lines":[{"line_number":1369,"context_line":"        self.assertEqual(\u0027queued\u0027, res_body[\u0027status\u0027])"},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"        def mock_store_add_to_backend_w_exception(*args, **kwargs):"},{"line_number":1372,"context_line":"            \"\"\"We are now mid upload and will emualate a failure by raising an"},{"line_number":1373,"context_line":"            exception."},{"line_number":1374,"context_line":"            \"\"\""},{"line_number":1375,"context_line":"            self._verify_image_status(image_id, \u0027saving\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAT3%2F%2F2Vs%3D","line":1372,"updated":"2013-12-30 08:19:40.000000000","message":"Nit: Typo ... \"emulate\"","commit_id":"e919c9c647d58c229f90db2ac06f312a0c4dfd51"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"599e3e23db72ea0b99c3d5648814aabbfc410eb3","unresolved":false,"context_lines":[{"line_number":1369,"context_line":"        self.assertEqual(\u0027queued\u0027, res_body[\u0027status\u0027])"},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"        def mock_store_add_to_backend_w_exception(*args, **kwargs):"},{"line_number":1372,"context_line":"            \"\"\"We are now mid upload and will emualate a failure by raising an"},{"line_number":1373,"context_line":"            exception."},{"line_number":1374,"context_line":"            \"\"\""},{"line_number":1375,"context_line":"            self._verify_image_status(image_id, \u0027saving\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2BxU8%3D","line":1372,"in_reply_to":"AAAAT3%2F%2F2Vs%3D","updated":"2014-01-22 11:49:44.000000000","message":"Done","commit_id":"e919c9c647d58c229f90db2ac06f312a0c4dfd51"},{"author":{"_account_id":9520,"name":"David Koo (koofoss)","email":"david.koo@huawei.com","username":"koofoss"},"change_message_id":"de63f2ba7a1422a4b8a4d53c1a9ff77f95aa77d5","unresolved":false,"context_lines":[{"line_number":1419,"context_line":"        self.assertTrue(\u0027status\u0027 in res_body)"},{"line_number":1420,"context_line":"        self.assertEqual(\u0027queued\u0027, res_body[\u0027status\u0027])"},{"line_number":1421,"context_line":""},{"line_number":1422,"context_line":"        def mock_store_add_to_backend_w_exception(*args, **kwargs):"},{"line_number":1423,"context_line":"            \"\"\"We are currently mid upload and the image should be in \u0027saving\u0027"},{"line_number":1424,"context_line":"            state. We now delete the image, assert status is \u0027deleted\u0027 then"},{"line_number":1425,"context_line":"            raise an exception to emulate a failed upload. This will be caught"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAT3%2F%2F2VI%3D","line":1422,"updated":"2013-12-30 08:19:40.000000000","message":"Going by the comments and the function body, I think this function was meant to be called \"mock_store_delete_from_backend_w_exception\" or something like that, no?","commit_id":"e919c9c647d58c229f90db2ac06f312a0c4dfd51"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"599e3e23db72ea0b99c3d5648814aabbfc410eb3","unresolved":false,"context_lines":[{"line_number":1419,"context_line":"        self.assertTrue(\u0027status\u0027 in res_body)"},{"line_number":1420,"context_line":"        self.assertEqual(\u0027queued\u0027, res_body[\u0027status\u0027])"},{"line_number":1421,"context_line":""},{"line_number":1422,"context_line":"        def mock_store_add_to_backend_w_exception(*args, **kwargs):"},{"line_number":1423,"context_line":"            \"\"\"We are currently mid upload and the image should be in \u0027saving\u0027"},{"line_number":1424,"context_line":"            state. We now delete the image, assert status is \u0027deleted\u0027 then"},{"line_number":1425,"context_line":"            raise an exception to emulate a failed upload. This will be caught"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2Bw20%3D","line":1422,"in_reply_to":"AAAAT3%2F%2F2VI%3D","updated":"2014-01-22 11:49:44.000000000","message":"Hi David, not quite. What we are doing here is emulating a DELETE request while an upload is still in progress so that when this method completes the status has gone from \u0027saving\u0027 to \u0027deleted\u0027 which will cause the upload to fail. We then check that the status is still \u0027deleted\u0027 and not \u0027killed\u0027 which is what was previously happening.","commit_id":"e919c9c647d58c229f90db2ac06f312a0c4dfd51"},{"author":{"_account_id":9520,"name":"David Koo (koofoss)","email":"david.koo@huawei.com","username":"koofoss"},"change_message_id":"de63f2ba7a1422a4b8a4d53c1a9ff77f95aa77d5","unresolved":false,"context_lines":[{"line_number":1440,"context_line":"            raise Exception(\"upload exception\")"},{"line_number":1441,"context_line":""},{"line_number":1442,"context_line":"        with patch.object(glance.store, \u0027store_add_to_backend\u0027) as mock_add:"},{"line_number":1443,"context_line":"            mock_add.side_effect \u003d mock_store_add_to_backend_w_exception"},{"line_number":1444,"context_line":""},{"line_number":1445,"context_line":"            # Now upload the image file along with some more"},{"line_number":1446,"context_line":"            # metadata and verify original metadata properties"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAT3%2F%2F2U0%3D","line":1443,"updated":"2013-12-30 08:19:40.000000000","message":"Was (and still am not) too familiar with Mock - this piece of code taught me lots ... was just was I was looking for to help me write some of my test cases. Many thanks :).","commit_id":"e919c9c647d58c229f90db2ac06f312a0c4dfd51"},{"author":{"_account_id":9520,"name":"David Koo (koofoss)","email":"david.koo@huawei.com","username":"koofoss"},"change_message_id":"337648f636db44b8a7ed49a169ac143b819c8ed9","unresolved":false,"context_lines":[{"line_number":1475,"context_line":"        self.assertEqual(mock_store_add_to_backend.call_count, 1)"},{"line_number":1476,"context_line":""},{"line_number":1477,"context_line":"    @mock.patch(\u0027glance.store.store_add_to_backend\u0027)"},{"line_number":1478,"context_line":"    def test_upload_safe_kill_deleted(self, mock_store_add_to_backend):"},{"line_number":1479,"context_line":"        fixture_headers \u003d {\u0027x-image-meta-store\u0027: \u0027file\u0027,"},{"line_number":1480,"context_line":"                           \u0027x-image-meta-disk-format\u0027: \u0027vhd\u0027,"},{"line_number":1481,"context_line":"                           \u0027x-image-meta-container-format\u0027: \u0027ovf\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F%2Brk4%3D","line":1478,"updated":"2014-01-23 09:09:41.000000000","message":"This and the previous function seem to have a lot of code in common - perhaps it be refactored into a common function? Something like:\n\n  def _upload_safe_kill_helper(mock_obj, mock_func, final_status, checked_deleted):\n      # all the setup\n      mock_obj.side_effect \u003d mock_func\n      # Now upload ...\n      self._verify_image_status(image_id, final_status, check_deleted)\n      self.assertEqual(mock_obj.call_count, 1)\n\n  @mock.patch(\u0027glance.store.store_add_to_backend\u0027)\n  def test_upload_safe_kill(self, mock_store_add_to_backend):\n      def mock_store_add_to_backend_w_exception(*args, **kwargs):\n          # ...\n    _upload_safe_kill_helper(mock_store_add_to_backend, \\\n        mock_store_add_to_backend_w_exception, \u0027killed\u0027, False)\n\n  ...","commit_id":"a840e0094f752acfc76cb4518fbc338b7d224d40"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"85c2b0b42d6514c95c12280a2c0804baf16efd89","unresolved":false,"context_lines":[{"line_number":1475,"context_line":"        self.assertEqual(mock_store_add_to_backend.call_count, 1)"},{"line_number":1476,"context_line":""},{"line_number":1477,"context_line":"    @mock.patch(\u0027glance.store.store_add_to_backend\u0027)"},{"line_number":1478,"context_line":"    def test_upload_safe_kill_deleted(self, mock_store_add_to_backend):"},{"line_number":1479,"context_line":"        fixture_headers \u003d {\u0027x-image-meta-store\u0027: \u0027file\u0027,"},{"line_number":1480,"context_line":"                           \u0027x-image-meta-disk-format\u0027: \u0027vhd\u0027,"},{"line_number":1481,"context_line":"                           \u0027x-image-meta-container-format\u0027: \u0027ovf\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"baada198_a431d2ee","line":1478,"in_reply_to":"AAAAUH%2F%2Brk4%3D","updated":"2014-07-21 11:18:50.000000000","message":"Done","commit_id":"a840e0094f752acfc76cb4518fbc338b7d224d40"},{"author":{"_account_id":12395,"name":"Roman Vasylets","email":"pomeo92@gmail.com","username":"rvasilets"},"change_message_id":"6b7d720f2771cc34304df5a9aafa84df992720fa","unresolved":false,"context_lines":[{"line_number":1542,"context_line":""},{"line_number":1543,"context_line":"    @mock.patch(\u0027glance.store.store_add_to_backend\u0027)"},{"line_number":1544,"context_line":"    def test_upload_safe_kill(self, mock_store_add_to_backend):"},{"line_number":1545,"context_line":"        self.image_status \u003d []"},{"line_number":1546,"context_line":""},{"line_number":1547,"context_line":"        def mock_store_add_to_backend_w_exception(*args, **kwargs):"},{"line_number":1548,"context_line":"            \"\"\"Trigger mid-upload failure by raising an exception.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_93ca729e","line":1545,"updated":"2014-07-25 10:55:35.000000000","message":"As this method is going to be a part of module public API lets add a docstring.","commit_id":"1150fd7085ba9deb3bcde309775cc59121aae3f8"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"92b63fa7752be7190bf4297f638b305dcb5ef8da","unresolved":false,"context_lines":[{"line_number":1542,"context_line":""},{"line_number":1543,"context_line":"    @mock.patch(\u0027glance.store.store_add_to_backend\u0027)"},{"line_number":1544,"context_line":"    def test_upload_safe_kill(self, mock_store_add_to_backend):"},{"line_number":1545,"context_line":"        self.image_status \u003d []"},{"line_number":1546,"context_line":""},{"line_number":1547,"context_line":"        def mock_store_add_to_backend_w_exception(*args, **kwargs):"},{"line_number":1548,"context_line":"            \"\"\"Trigger mid-upload failure by raising an exception.\"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_0b47fb1d","line":1545,"in_reply_to":"baada198_93ca729e","updated":"2014-07-25 18:42:35.000000000","message":"Done","commit_id":"1150fd7085ba9deb3bcde309775cc59121aae3f8"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"435082a959719e16a7eb427e1eef8494b0ef0a44","unresolved":false,"context_lines":[{"line_number":1341,"context_line":"        def mock_image_update(context, values, image_id, purge_props\u003dFalse,"},{"line_number":1342,"context_line":"                              from_state\u003dNone):"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"            status \u003d values.get(\u0027status\u0027, None)"},{"line_number":1345,"context_line":"            if status:"},{"line_number":1346,"context_line":"                state_changes.append(status)"},{"line_number":1347,"context_line":"                if status \u003d\u003d \u0027active\u0027:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_36a64d0e","line":1344,"updated":"2014-08-07 00:25:53.000000000","message":"don\u0027t think you need to specify the default here","commit_id":"f7afc6655531ec652f55d003c672e7b108c39430"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"119bcc6a8401327cce0f1f58877a0dbe9cc8d308","unresolved":false,"context_lines":[{"line_number":1341,"context_line":"        def mock_image_update(context, values, image_id, purge_props\u003dFalse,"},{"line_number":1342,"context_line":"                              from_state\u003dNone):"},{"line_number":1343,"context_line":""},{"line_number":1344,"context_line":"            status \u003d values.get(\u0027status\u0027, None)"},{"line_number":1345,"context_line":"            if status:"},{"line_number":1346,"context_line":"                state_changes.append(status)"},{"line_number":1347,"context_line":"                if status \u003d\u003d \u0027active\u0027:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_557814f7","line":1344,"in_reply_to":"baada198_36a64d0e","updated":"2014-08-07 04:08:02.000000000","message":"Done","commit_id":"f7afc6655531ec652f55d003c672e7b108c39430"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"435082a959719e16a7eb427e1eef8494b0ef0a44","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                        self.assertTrue(mock_db_update.called)"},{"line_number":1425,"context_line":""},{"line_number":1426,"context_line":"                        # Ensure cleanup occured."},{"line_number":1427,"context_line":"                        self.assertEqual(mock_init_del.call_count, 1)"},{"line_number":1428,"context_line":""},{"line_number":1429,"context_line":"                        self.assertEqual(state_changes, [\u0027saving\u0027, \u0027active\u0027])"},{"line_number":1430,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_d6c6f19b","line":1427,"updated":"2014-08-07 00:25:53.000000000","message":"ditto","commit_id":"f7afc6655531ec652f55d003c672e7b108c39430"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"119bcc6a8401327cce0f1f58877a0dbe9cc8d308","unresolved":false,"context_lines":[{"line_number":1424,"context_line":"                        self.assertTrue(mock_db_update.called)"},{"line_number":1425,"context_line":""},{"line_number":1426,"context_line":"                        # Ensure cleanup occured."},{"line_number":1427,"context_line":"                        self.assertEqual(mock_init_del.call_count, 1)"},{"line_number":1428,"context_line":""},{"line_number":1429,"context_line":"                        self.assertEqual(state_changes, [\u0027saving\u0027, \u0027active\u0027])"},{"line_number":1430,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_9582acc5","line":1427,"in_reply_to":"baada198_d6c6f19b","updated":"2014-08-07 04:08:02.000000000","message":"Done","commit_id":"f7afc6655531ec652f55d003c672e7b108c39430"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"435082a959719e16a7eb427e1eef8494b0ef0a44","unresolved":false,"context_lines":[{"line_number":1498,"context_line":"        else:"},{"line_number":1499,"context_line":"            res \u003d self.image_status.pop(0)"},{"line_number":1500,"context_line":""},{"line_number":1501,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":1502,"context_line":"        self.assertEqual(res.headers[\u0027x-image-meta-status\u0027], status)"},{"line_number":1503,"context_line":"        self.assertEqual(res.headers[\u0027x-image-meta-deleted\u0027],"},{"line_number":1504,"context_line":"                         str(check_deleted))"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_967e396c","line":1501,"updated":"2014-08-07 00:25:53.000000000","message":"would you mind put the expected first?","commit_id":"f7afc6655531ec652f55d003c672e7b108c39430"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"119bcc6a8401327cce0f1f58877a0dbe9cc8d308","unresolved":false,"context_lines":[{"line_number":1498,"context_line":"        else:"},{"line_number":1499,"context_line":"            res \u003d self.image_status.pop(0)"},{"line_number":1500,"context_line":""},{"line_number":1501,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":1502,"context_line":"        self.assertEqual(res.headers[\u0027x-image-meta-status\u0027], status)"},{"line_number":1503,"context_line":"        self.assertEqual(res.headers[\u0027x-image-meta-deleted\u0027],"},{"line_number":1504,"context_line":"                         str(check_deleted))"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_d5634443","line":1501,"in_reply_to":"baada198_967e396c","updated":"2014-08-07 04:08:02.000000000","message":"Done","commit_id":"f7afc6655531ec652f55d003c672e7b108c39430"}],"glance/tests/unit/v1/test_upload_utils.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2877a5218fb00de0e42a3f7c6230b1cc4b4116c4","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        id \u003d unit_test_utils.UUID1"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        self.mox.StubOutWithMock(registry, \"update_image_metadata\")"},{"line_number":74,"context_line":"        self.mox.StubOutWithMock(registry, \"get_image_metadata\")"},{"line_number":75,"context_line":"        meta \u003d {\u0027status\u0027: \u0027saving\u0027}"},{"line_number":76,"context_line":"        registry.get_image_metadata(req.context, id).AndReturn(meta)"},{"line_number":77,"context_line":"        registry.update_image_metadata(req.context, id, {\u0027status\u0027: \u0027killed\u0027})"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F%2FRBs%3D","line":74,"updated":"2013-11-12 01:58:32.000000000","message":"I feel like we should use mock for all tests which are getting changed here.","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"7b58397075111f21099d857edc8e1ba271021ac9","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        id \u003d unit_test_utils.UUID1"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        self.mox.StubOutWithMock(registry, \"update_image_metadata\")"},{"line_number":74,"context_line":"        self.mox.StubOutWithMock(registry, \"get_image_metadata\")"},{"line_number":75,"context_line":"        meta \u003d {\u0027status\u0027: \u0027saving\u0027}"},{"line_number":76,"context_line":"        registry.get_image_metadata(req.context, id).AndReturn(meta)"},{"line_number":77,"context_line":"        registry.update_image_metadata(req.context, id, {\u0027status\u0027: \u0027killed\u0027})"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F95yc%3D","line":74,"in_reply_to":"AAAATn%2F%2FRBs%3D","updated":"2013-12-04 19:36:11.000000000","message":"Tough call Nikhil...I would definitely feel better if these tests were using mock but I don\u0027t know if it\u0027s fair to have him do that work right now since these tests already exist. Although, it may make it easier to have more robust tests.","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"e641705d2dbdf87b2de0f99d1d6edd54800a35e3","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        id \u003d unit_test_utils.UUID1"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        self.mox.StubOutWithMock(registry, \"update_image_metadata\")"},{"line_number":74,"context_line":"        self.mox.StubOutWithMock(registry, \"get_image_metadata\")"},{"line_number":75,"context_line":"        meta \u003d {\u0027status\u0027: \u0027saving\u0027}"},{"line_number":76,"context_line":"        registry.get_image_metadata(req.context, id).AndReturn(meta)"},{"line_number":77,"context_line":"        registry.update_image_metadata(req.context, id, {\u0027status\u0027: \u0027killed\u0027})"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F91do%3D","line":74,"in_reply_to":"AAAATn%2F95LU%3D","updated":"2013-12-05 12:46:08.000000000","message":"Again, we can schedule a new task to convert to mock. Doing it in this patchset will only increase the complexity of the review.","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"0f686af8995653ca1d687c6d225f30b36c65fbbe","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        id \u003d unit_test_utils.UUID1"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        self.mox.StubOutWithMock(registry, \"update_image_metadata\")"},{"line_number":74,"context_line":"        self.mox.StubOutWithMock(registry, \"get_image_metadata\")"},{"line_number":75,"context_line":"        meta \u003d {\u0027status\u0027: \u0027saving\u0027}"},{"line_number":76,"context_line":"        registry.get_image_metadata(req.context, id).AndReturn(meta)"},{"line_number":77,"context_line":"        registry.update_image_metadata(req.context, id, {\u0027status\u0027: \u0027killed\u0027})"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F95LU%3D","line":74,"in_reply_to":"AAAATn%2F95yc%3D","updated":"2013-12-04 19:54:16.000000000","message":"Fair deal.","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"7b58397075111f21099d857edc8e1ba271021ac9","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        self.mox.StubOutWithMock(registry, \"get_image_metadata\")"},{"line_number":107,"context_line":"        meta \u003d {\u0027status\u0027: \u0027deleted\u0027}"},{"line_number":108,"context_line":"        registry.get_image_metadata(req.context, id).AndReturn(meta)"},{"line_number":109,"context_line":"        self.mox.ReplayAll()"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        upload_utils.safe_kill(req, id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F95M4%3D","line":108,"updated":"2013-12-04 19:36:11.000000000","message":"I think there needs to be some sort of assertion to make sure that update_image_metadata is not called. Otherwise the test is not assuring that the image is not set to killed. If I comment out the lines that check if an image is deleted in guarded_image_update then this test still passes.","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"47cb510b2a90522b45f330f4a8f8d69ee551e21c","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        self.mox.StubOutWithMock(registry, \"get_image_metadata\")"},{"line_number":107,"context_line":"        meta \u003d {\u0027status\u0027: \u0027deleted\u0027}"},{"line_number":108,"context_line":"        registry.get_image_metadata(req.context, id).AndReturn(meta)"},{"line_number":109,"context_line":"        self.mox.ReplayAll()"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        upload_utils.safe_kill(req, id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F91ao%3D","line":108,"in_reply_to":"AAAATn%2F91dA%3D","updated":"2013-12-05 13:22:43.000000000","message":"Actually now that I look at it, if update_image_metadata gets called an exception will be thrown so no need to check it.","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"e641705d2dbdf87b2de0f99d1d6edd54800a35e3","unresolved":false,"context_lines":[{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        self.mox.StubOutWithMock(registry, \"get_image_metadata\")"},{"line_number":107,"context_line":"        meta \u003d {\u0027status\u0027: \u0027deleted\u0027}"},{"line_number":108,"context_line":"        registry.get_image_metadata(req.context, id).AndReturn(meta)"},{"line_number":109,"context_line":"        self.mox.ReplayAll()"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"        upload_utils.safe_kill(req, id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F91dA%3D","line":108,"in_reply_to":"AAAATn%2F95M4%3D","updated":"2013-12-05 12:46:08.000000000","message":"Fair enough I\u0027ll add in a check.","commit_id":"ed2adfd80a92cc73f3f33187334c87bbb34a010b"}]}
