)]}'
{"glance/api/v1/images.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"            # to delete the image if the backend doesn\u0027t yet store it."},{"line_number":1005,"context_line":"            # See https://bugs.launchpad.net/glance/+bug/747799"},{"line_number":1006,"context_line":"            if image[\u0027location\u0027]:"},{"line_number":1007,"context_line":"                for loc in image[\u0027location_data\u0027]:"},{"line_number":1008,"context_line":"                    if loc[\u0027status\u0027] \u003d\u003d \u0027active\u0027:"},{"line_number":1009,"context_line":"                        upload_utils.initiate_deletion(req, loc, id)"},{"line_number":1010,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL8w%3D","line":1007,"updated":"2014-02-15 02:32:00.000000000","message":"nit: could you rename loc to loc_data here? \nMy brain associates loc with location_url and not with location_data.\nI think this will be easier to read/understand with loc_data.","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":1004,"context_line":"            # to delete the image if the backend doesn\u0027t yet store it."},{"line_number":1005,"context_line":"            # See https://bugs.launchpad.net/glance/+bug/747799"},{"line_number":1006,"context_line":"            if image[\u0027location\u0027]:"},{"line_number":1007,"context_line":"                for loc in image[\u0027location_data\u0027]:"},{"line_number":1008,"context_line":"                    if loc[\u0027status\u0027] \u003d\u003d \u0027active\u0027:"},{"line_number":1009,"context_line":"                        upload_utils.initiate_deletion(req, loc, id)"},{"line_number":1010,"context_line":"        except exception.NotFound as e:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6po%3D","line":1007,"in_reply_to":"AAAAUX%2F%2FL8w%3D","updated":"2014-02-18 08:57:59.000000000","message":"Np, done.","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8c4e882e141f5235e294235e37da127e844f460c","unresolved":false,"context_lines":[{"line_number":665,"context_line":"        # This is necessary because of a bug in Webob 1.0.2 - 1.0.7"},{"line_number":666,"context_line":"        # See: https://bitbucket.org/ianb/webob/"},{"line_number":667,"context_line":"        # issue/12/fix-for-issue-6-broke-chunked-transfer"},{"line_number":668,"context_line":"        req.is_body_readable \u003d True"},{"line_number":669,"context_line":"        location_data \u003d self._upload(req, image_meta)"},{"line_number":670,"context_line":"        return self._activate(req,"},{"line_number":671,"context_line":"                              image_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"1ae5cdf2_64508e2c","line":668,"updated":"2014-06-20 09:46:22.000000000","message":"Any chance you could drop this one off once you are here? Seems that this has not been relevant for ages anymore. (Wouldn\u0027t even ask unless you were not refactoring almost whole function already.)","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c96357ca90eff68d8121d28dc89ec5718749d231","unresolved":false,"context_lines":[{"line_number":665,"context_line":"        # This is necessary because of a bug in Webob 1.0.2 - 1.0.7"},{"line_number":666,"context_line":"        # See: https://bitbucket.org/ianb/webob/"},{"line_number":667,"context_line":"        # issue/12/fix-for-issue-6-broke-chunked-transfer"},{"line_number":668,"context_line":"        req.is_body_readable \u003d True"},{"line_number":669,"context_line":"        location_data \u003d self._upload(req, image_meta)"},{"line_number":670,"context_line":"        return self._activate(req,"},{"line_number":671,"context_line":"                              image_id,"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_902bdc81","line":668,"in_reply_to":"1ae5cdf2_64508e2c","updated":"2014-06-30 09:18:36.000000000","message":"Done","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"}],"glance/api/v1/upload_utils.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def initiate_deletion(req, location_data, id):"},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":"    Deletes image data from the backend store."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    :param req: The WSGI/Webob Request object"},{"line_number":38,"context_line":"    :param location_data: Location to the image data in a data store"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL7o%3D","line":35,"updated":"2014-02-15 02:32:00.000000000","message":"Deletes image location data from the backend store no?","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def initiate_deletion(req, location_data, id):"},{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":"    Deletes image data from the backend store."},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    :param req: The WSGI/Webob Request object"},{"line_number":38,"context_line":"    :param location_data: Location to the image data in a data store"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6lE%3D","line":35,"in_reply_to":"AAAAUX%2F%2FL7o%3D","updated":"2014-02-18 08:57:59.000000000","message":"Done","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"}],"glance/api/v2/images.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":599,"context_line":"                if active_locations:"},{"line_number":600,"context_line":"                    # Choose best location configured strategy"},{"line_number":601,"context_line":"                    best_location \u003d choose_best_location(active_locations)"},{"line_number":602,"context_line":"                    image_view[\u0027direct_url\u0027] \u003d best_location[\u0027url\u0027]"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"            image_view[\u0027tags\u0027] \u003d list(image.tags)"},{"line_number":605,"context_line":"            image_view[\u0027self\u0027] \u003d self._get_image_href(image)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL50%3D","line":602,"updated":"2014-02-15 02:32:00.000000000","message":"could you add a else with a log \"no active location found\".","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":599,"context_line":"                if active_locations:"},{"line_number":600,"context_line":"                    # Choose best location configured strategy"},{"line_number":601,"context_line":"                    best_location \u003d choose_best_location(active_locations)"},{"line_number":602,"context_line":"                    image_view[\u0027direct_url\u0027] \u003d best_location[\u0027url\u0027]"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"            image_view[\u0027tags\u0027] \u003d list(image.tags)"},{"line_number":605,"context_line":"            image_view[\u0027self\u0027] \u003d self._get_image_href(image)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6ik%3D","line":602,"in_reply_to":"AAAAUX%2F%2FL50%3D","updated":"2014-02-18 08:57:59.000000000","message":"Done","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                change_method(req, image, change)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"            if changes:"},{"line_number":126,"context_line":"                image_repo.save(image)"},{"line_number":127,"context_line":"        except exception.NotFound as e:"},{"line_number":128,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dunicode(e))"},{"line_number":129,"context_line":"        except exception.Forbidden as e:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn84%3D","line":126,"updated":"2014-03-02 16:56:02.000000000","message":"I think this issue has been fixed by koofoss\u0027s patch.","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                change_method(req, image, change)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"            if changes:"},{"line_number":126,"context_line":"                image_repo.save(image)"},{"line_number":127,"context_line":"        except exception.NotFound as e:"},{"line_number":128,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dunicode(e))"},{"line_number":129,"context_line":"        except exception.Forbidden as e:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxUo%3D","line":126,"in_reply_to":"AAAAVX%2F%2Fn84%3D","updated":"2014-03-04 08:36:53.000000000","message":"Yup","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":269,"context_line":"class RequestDeserializer(wsgi.JSONRequestDeserializer):"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    _disallowed_properties \u003d [\u0027direct_url\u0027, \u0027self\u0027, \u0027file\u0027, \u0027schema\u0027]"},{"line_number":272,"context_line":"    _readonly_image_properties \u003d [\u0027created_at\u0027, \u0027updated_at\u0027, \u0027status\u0027,"},{"line_number":273,"context_line":"                                  \u0027checksum\u0027, \u0027size\u0027, \u0027virtual_size\u0027,"},{"line_number":274,"context_line":"                                  \u0027direct_url\u0027, \u0027self\u0027, \u0027file\u0027, \u0027schema\u0027]"},{"line_number":275,"context_line":"    _reserved_image_properties \u003d [\u0027owner\u0027, \u0027is_public\u0027, \u0027location\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn8w%3D","line":272,"updated":"2014-03-02 16:56:02.000000000","message":"Why do we rename these variables?","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":269,"context_line":"class RequestDeserializer(wsgi.JSONRequestDeserializer):"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    _disallowed_properties \u003d [\u0027direct_url\u0027, \u0027self\u0027, \u0027file\u0027, \u0027schema\u0027]"},{"line_number":272,"context_line":"    _readonly_image_properties \u003d [\u0027created_at\u0027, \u0027updated_at\u0027, \u0027status\u0027,"},{"line_number":273,"context_line":"                                  \u0027checksum\u0027, \u0027size\u0027, \u0027virtual_size\u0027,"},{"line_number":274,"context_line":"                                  \u0027direct_url\u0027, \u0027self\u0027, \u0027file\u0027, \u0027schema\u0027]"},{"line_number":275,"context_line":"    _reserved_image_properties \u003d [\u0027owner\u0027, \u0027is_public\u0027, \u0027location\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxUY%3D","line":272,"in_reply_to":"AAAAVX%2F%2Fn8w%3D","updated":"2014-03-04 08:36:53.000000000","message":"It\u0027s more clear to us I think.","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":394,"context_line":"    def _validate_change(self, change):"},{"line_number":395,"context_line":"        path_root \u003d change[\u0027path\u0027][0]"},{"line_number":396,"context_line":"        if path_root in self._readonly_image_properties:"},{"line_number":397,"context_line":"            msg \u003d \"Image attribute \\\u0027%s\\\u0027 is read-only.\" % path_root"},{"line_number":398,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003dunicode(msg))"},{"line_number":399,"context_line":"        if path_root in self._reserved_image_properties:"},{"line_number":400,"context_line":"            msg \u003d \"Image attribute \\\u0027%s\\\u0027 is reserved.\" % path_root"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn8o%3D","line":397,"updated":"2014-03-02 16:56:02.000000000","message":"Seems they are not related to this patch.","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":394,"context_line":"    def _validate_change(self, change):"},{"line_number":395,"context_line":"        path_root \u003d change[\u0027path\u0027][0]"},{"line_number":396,"context_line":"        if path_root in self._readonly_image_properties:"},{"line_number":397,"context_line":"            msg \u003d \"Image attribute \\\u0027%s\\\u0027 is read-only.\" % path_root"},{"line_number":398,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003dunicode(msg))"},{"line_number":399,"context_line":"        if path_root in self._reserved_image_properties:"},{"line_number":400,"context_line":"            msg \u003d \"Image attribute \\\u0027%s\\\u0027 is reserved.\" % path_root"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxUU%3D","line":397,"in_reply_to":"AAAAVX%2F%2Fn8o%3D","updated":"2014-03-04 08:36:53.000000000","message":"Done, revert.","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"b60b239374d52a5c89378b9181dd0ecc80e60987","unresolved":false,"context_lines":[{"line_number":593,"context_line":"                    # image.locations is None to indicate it\u0027s allowed to show"},{"line_number":594,"context_line":"                    # locations but it\u0027s just non-existent."},{"line_number":595,"context_line":"                    image_view[\u0027locations\u0027] \u003d []"},{"line_number":596,"context_line":"                    LOG.debug(\"There is no any available location \""},{"line_number":597,"context_line":"                              \"for image %s\" % image.image_id)"},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"            if CONF.show_image_direct_url:"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_88b60a89","line":596,"updated":"2014-07-10 15:21:53.000000000","message":"typo: \u0027There is no any\u0027 -\u003e \u0027There is not\u0027","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"bbc4ef4358ed345ac921b49a582d34c523f79037","unresolved":false,"context_lines":[{"line_number":593,"context_line":"                    # image.locations is None to indicate it\u0027s allowed to show"},{"line_number":594,"context_line":"                    # locations but it\u0027s just non-existent."},{"line_number":595,"context_line":"                    image_view[\u0027locations\u0027] \u003d []"},{"line_number":596,"context_line":"                    LOG.debug(\"There is no any available location \""},{"line_number":597,"context_line":"                              \"for image %s\" % image.image_id)"},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"            if CONF.show_image_direct_url:"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_44075d1d","line":596,"in_reply_to":"baada198_88b60a89","updated":"2014-07-11 05:43:51.000000000","message":"Done","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"b60b239374d52a5c89378b9181dd0ecc80e60987","unresolved":false,"context_lines":[{"line_number":602,"context_line":"                    l \u003d location_strategy.choose_best_location(image.locations)"},{"line_number":603,"context_line":"                    image_view[\u0027direct_url\u0027] \u003d l[\u0027url\u0027]"},{"line_number":604,"context_line":"                else:"},{"line_number":605,"context_line":"                    LOG.debug(\"There is no any available location \""},{"line_number":606,"context_line":"                              \"for image %s\" % image.image_id)"},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"            image_view[\u0027tags\u0027] \u003d list(image.tags)"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_08aafa18","line":605,"updated":"2014-07-10 15:21:53.000000000","message":"typo: as above","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"bbc4ef4358ed345ac921b49a582d34c523f79037","unresolved":false,"context_lines":[{"line_number":602,"context_line":"                    l \u003d location_strategy.choose_best_location(image.locations)"},{"line_number":603,"context_line":"                    image_view[\u0027direct_url\u0027] \u003d l[\u0027url\u0027]"},{"line_number":604,"context_line":"                else:"},{"line_number":605,"context_line":"                    LOG.debug(\"There is no any available location \""},{"line_number":606,"context_line":"                              \"for image %s\" % image.image_id)"},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"            image_view[\u0027tags\u0027] \u003d list(image.tags)"}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_9ffffe00","line":605,"in_reply_to":"baada198_08aafa18","updated":"2014-07-11 05:43:51.000000000","message":"Done","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"}],"glance/api/v2/location_utils.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def get_image_active_locations(image):"},{"line_number":17,"context_line":"    ret \u003d []"},{"line_number":18,"context_line":"    if image and image.locations:"},{"line_number":19,"context_line":"        for loc in image.locations:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL5w%3D","line":16,"updated":"2014-02-15 02:32:00.000000000","message":"Can\u0027t you put this function somewhere else? :)","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def get_image_active_locations(image):"},{"line_number":17,"context_line":"    ret \u003d []"},{"line_number":18,"context_line":"    if image and image.locations:"},{"line_number":19,"context_line":"        for loc in image.locations:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6fQ%3D","line":16,"in_reply_to":"AAAAUX%2F%2FL5w%3D","updated":"2014-02-18 08:57:59.000000000","message":"Seems we like put this util here https://review.openstack.org/#/c/41311/18/glance/api/v2/__init__.py , may I know your special idea in your mind?","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def get_image_active_locations(image):"},{"line_number":17,"context_line":"    ret \u003d []"},{"line_number":18,"context_line":"    if image and image.locations:"},{"line_number":19,"context_line":"        for loc in image.locations:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn8k%3D","line":16,"updated":"2014-03-02 16:56:02.000000000","message":"Do we really need this new file? And seems the file name is too specific.","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def get_image_active_locations(image):"},{"line_number":17,"context_line":"    ret \u003d []"},{"line_number":18,"context_line":"    if image and image.locations:"},{"line_number":19,"context_line":"        for loc in image.locations:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxTc%3D","line":16,"in_reply_to":"AAAAVX%2F%2Fn8k%3D","updated":"2014-03-04 08:36:53.000000000","message":"Seems flaper87 like put this util here https://review.openstack.org/#/c/41311/18/glance/api/v2/__init__.py , and I thought it\u0027s not a big deal and agreed.","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"78a886f98d80fcd59ae64ebd371aeaf40c2bf84c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def get_image_active_locations(image):"},{"line_number":17,"context_line":"    ret \u003d []"},{"line_number":18,"context_line":"    if image and image.locations:"},{"line_number":19,"context_line":"        for loc in image.locations:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAWH%2F%2F8Zc%3D","line":16,"updated":"2014-03-12 19:21:44.000000000","message":"Is there any chance we can move this filtering down into the domain layer? I\u0027m curious if the api really needs access to any image locations that are not \u0027active\u0027 ?\n\nI know the scrubber needs image locations that aren\u0027t active, but maybe we need a different code path for accessing those locations?","commit_id":"4e11da78239df52d6aad243ca6a4eb94fe76645b"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"9ca3e5cda97d32f0e0a0704edf19d491da16be6c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"def get_image_active_locations(image):"},{"line_number":17,"context_line":"    ret \u003d []"},{"line_number":18,"context_line":"    if image and image.locations:"},{"line_number":19,"context_line":"        for loc in image.locations:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAWH%2F%2FQbY%3D","line":16,"in_reply_to":"AAAAWH%2F%2F8Zc%3D","updated":"2014-03-19 03:44:45.000000000","message":"Hi Mark,\n\nI tried to catch you in IRC but seems there is no luck, so please let me write the feedback at here.\n\nOK, I think DB ImageRepo is a good target place to move this filtering down into the domain layer. Thanks! And I have prepared a new PS with this approach, if you OK I will push it up to this review thread.\n\nScrubber can get all locations data directly by registry api or db api instead of through domain, so it\u0027s OK, IMO.\n\nLet me know if I miss anything.","commit_id":"4e11da78239df52d6aad243ca6a4eb94fe76645b"}],"glance/common/store_utils.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#    Copyright 2014 IBM Corp."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL40%3D","line":1,"updated":"2014-02-15 02:32:00.000000000","message":"I would rename this file store_location_utils.py\nEverything in it is related to location and store","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#    Copyright 2014 IBM Corp."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6eg%3D","line":1,"in_reply_to":"AAAAUX%2F%2FL40%3D","updated":"2014-02-18 08:57:59.000000000","message":"IMHO we can add more store related utils into here, for now and in future. Am I miss anything?","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    except store_api.UnsupportedBackend:"},{"line_number":55,"context_line":"        exc_type \u003d sys.exc_info()[0].__name__"},{"line_number":56,"context_line":"        msg \u003d (_(\u0027Failed to delete image %(image_id)s from store: %(exc)s\u0027) %"},{"line_number":57,"context_line":"               dict(image_id\u003dimage_id, exc\u003dexc_type))"},{"line_number":58,"context_line":"        LOG.error(msg)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL4U%3D","line":57,"updated":"2014-02-15 02:32:00.000000000","message":"nit: do we prefer % dict(...) or % {\u0027x\u0027:a, \u0027y\u0027:b}? do we care? :)","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    except store_api.UnsupportedBackend:"},{"line_number":55,"context_line":"        exc_type \u003d sys.exc_info()[0].__name__"},{"line_number":56,"context_line":"        msg \u003d (_(\u0027Failed to delete image %(image_id)s from store: %(exc)s\u0027) %"},{"line_number":57,"context_line":"               dict(image_id\u003dimage_id, exc\u003dexc_type))"},{"line_number":58,"context_line":"        LOG.error(msg)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6dk%3D","line":57,"in_reply_to":"AAAAUX%2F%2FL4U%3D","updated":"2014-02-18 08:57:59.000000000","message":"TBH I think current naming is more clear to me/us, no? thanks.","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        LOG.error(msg)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def schedule_delayed_delete_from_backend(context, image_id, location,"},{"line_number":62,"context_line":"                                         **kwargs):"},{"line_number":63,"context_line":"    \"\"\""},{"line_number":64,"context_line":"    Given a location, schedule the deletion of an image location and"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL4I%3D","line":61,"updated":"2014-02-15 02:32:00.000000000","message":"I don\u0027t think you need **kwargs in this function.","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        LOG.error(msg)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def schedule_delayed_delete_from_backend(context, image_id, location,"},{"line_number":62,"context_line":"                                         **kwargs):"},{"line_number":63,"context_line":"    \"\"\""},{"line_number":64,"context_line":"    Given a location, schedule the deletion of an image location and"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6bA%3D","line":61,"in_reply_to":"AAAAUX%2F%2FL4I%3D","updated":"2014-02-18 08:57:59.000000000","message":"The reason to me to put it here is trying to keep consistent and reusable for this function[1]. And maybe in future we can implement this function by another approach, I think probably this is the reason why we put it here in original code.\n\nBut it is not a bug deal to me, will remove it in next PS.\n\n[1] https://github.com/openstack/glance/blob/master/glance/store/__init__.py#L317","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    return ret"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"def delete_image_from_backend(context, store_utils, image_id, location):"},{"line_number":82,"context_line":"    deleted \u003d False"},{"line_number":83,"context_line":"    if CONF.delayed_delete:"},{"line_number":84,"context_line":"        deleted \u003d store_utils.schedule_delayed_delete_from_backend(context,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL8M%3D","line":81,"updated":"2014-02-15 02:32:00.000000000","message":"I would rename this to delete_location_from_backend(...) or delete_image_location_from_backend(...)","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    return ret"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"def delete_image_from_backend(context, store_utils, image_id, location):"},{"line_number":82,"context_line":"    deleted \u003d False"},{"line_number":83,"context_line":"    if CONF.delayed_delete:"},{"line_number":84,"context_line":"        deleted \u003d store_utils.schedule_delayed_delete_from_backend(context,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6Zg%3D","line":81,"in_reply_to":"AAAAUX%2F%2FL8M%3D","updated":"2014-02-18 08:57:59.000000000","message":"delete_image_location_from_backend is make more sense to me.","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def safe_delete_from_backend(context, image_id, location):"},{"line_number":38,"context_line":"    \"\"\""},{"line_number":39,"context_line":"    Given a location, delete an image from the store and"},{"line_number":40,"context_line":"    update location status to db."},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn8Y%3D","line":39,"updated":"2014-03-02 16:56:02.000000000","message":"It would be nice if the type of \u0027location\u0027 can be documented.","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def safe_delete_from_backend(context, image_id, location):"},{"line_number":38,"context_line":"    \"\"\""},{"line_number":39,"context_line":"    Given a location, delete an image from the store and"},{"line_number":40,"context_line":"    update location status to db."},{"line_number":41,"context_line":"    \"\"\""},{"line_number":42,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxS0%3D","line":39,"in_reply_to":"AAAAVX%2F%2Fn8Y%3D","updated":"2014-03-04 08:36:53.000000000","message":"Done","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def schedule_delayed_delete_from_backend(context, image_id, location):"},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    Given a location, schedule the deletion of an image location and"},{"line_number":64,"context_line":"    update location status to db."},{"line_number":65,"context_line":"    \"\"\""},{"line_number":66,"context_line":"    (file_queue, _db_queue) \u003d scrubber.get_scrub_queues()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn8Q%3D","line":63,"updated":"2014-03-02 16:56:02.000000000","message":"ditto","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def schedule_delayed_delete_from_backend(context, image_id, location):"},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    Given a location, schedule the deletion of an image location and"},{"line_number":64,"context_line":"    update location status to db."},{"line_number":65,"context_line":"    \"\"\""},{"line_number":66,"context_line":"    (file_queue, _db_queue) \u003d scrubber.get_scrub_queues()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxSs%3D","line":63,"in_reply_to":"AAAAVX%2F%2Fn8Q%3D","updated":"2014-03-04 08:36:53.000000000","message":"Done","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    ret \u003d file_queue.add_location(image_id, location, user_context\u003dcontext)"},{"line_number":71,"context_line":"    if ret:"},{"line_number":72,"context_line":"        location[\u0027status\u0027] \u003d \u0027pending_delete\u0027"},{"line_number":73,"context_line":"        if \u0027id\u0027 in location:"},{"line_number":74,"context_line":"            db_api.get_api().image_location_delete(context, image_id,"},{"line_number":75,"context_line":"                                                   location[\u0027id\u0027],"},{"line_number":76,"context_line":"                                                   \u0027pending_delete\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn8E%3D","line":73,"updated":"2014-03-02 16:56:02.000000000","message":"Is there any scenario that the id is not existed in location?","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    ret \u003d file_queue.add_location(image_id, location, user_context\u003dcontext)"},{"line_number":71,"context_line":"    if ret:"},{"line_number":72,"context_line":"        location[\u0027status\u0027] \u003d \u0027pending_delete\u0027"},{"line_number":73,"context_line":"        if \u0027id\u0027 in location:"},{"line_number":74,"context_line":"            db_api.get_api().image_location_delete(context, image_id,"},{"line_number":75,"context_line":"                                                   location[\u0027id\u0027],"},{"line_number":76,"context_line":"                                                   \u0027pending_delete\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxQs%3D","line":73,"in_reply_to":"AAAAVX%2F%2Fn8E%3D","updated":"2014-03-04 08:36:53.000000000","message":"The new added image location entry will has no \u0027id\u0027 field since it has not been saved to DB.\n\nAlso added above explaining as an inline notes within the code.","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                                                                   location)"},{"line_number":87,"context_line":"    if not deleted:"},{"line_number":88,"context_line":"        # NOTE(zhiyan) If image metadata has not been saved to DB"},{"line_number":89,"context_line":"        # such as uploading process failure then we can\u0027t using"},{"line_number":90,"context_line":"        # location status mechanism to support image pending delete."},{"line_number":91,"context_line":"        store_utils.safe_delete_from_backend(context, image_id, location)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn8M%3D","line":89,"updated":"2014-03-02 16:56:02.000000000","message":"(nit): we can\u0027t use?","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                                                                   location)"},{"line_number":87,"context_line":"    if not deleted:"},{"line_number":88,"context_line":"        # NOTE(zhiyan) If image metadata has not been saved to DB"},{"line_number":89,"context_line":"        # such as uploading process failure then we can\u0027t using"},{"line_number":90,"context_line":"        # location status mechanism to support image pending delete."},{"line_number":91,"context_line":"        store_utils.safe_delete_from_backend(context, image_id, location)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxSU%3D","line":89,"in_reply_to":"AAAAVX%2F%2Fn8M%3D","updated":"2014-03-04 08:36:53.000000000","message":"Done","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8c4e882e141f5235e294235e37da127e844f460c","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                                   location[\u0027id\u0027], \u0027deleted\u0027)"},{"line_number":54,"context_line":"        return ret"},{"line_number":55,"context_line":"    except exception.NotFound:"},{"line_number":56,"context_line":"        msg \u003d _(\u0027Failed to delete image %s in store from URI\u0027) % image_id"},{"line_number":57,"context_line":"        LOG.warn(msg)"},{"line_number":58,"context_line":"    except exception.StoreDeleteNotSupported as e:"},{"line_number":59,"context_line":"        LOG.warn(utils.exception_to_str(e))"}],"source_content_type":"text/x-python","patch_set":11,"id":"1ae5cdf2_894bf385","line":56,"updated":"2014-06-20 09:46:22.000000000","message":"_LW(\nhttps://wiki.openstack.org/wiki/LoggingStandards#Guidelines","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c96357ca90eff68d8121d28dc89ec5718749d231","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                                   location[\u0027id\u0027], \u0027deleted\u0027)"},{"line_number":54,"context_line":"        return ret"},{"line_number":55,"context_line":"    except exception.NotFound:"},{"line_number":56,"context_line":"        msg \u003d _(\u0027Failed to delete image %s in store from URI\u0027) % image_id"},{"line_number":57,"context_line":"        LOG.warn(msg)"},{"line_number":58,"context_line":"    except exception.StoreDeleteNotSupported as e:"},{"line_number":59,"context_line":"        LOG.warn(utils.exception_to_str(e))"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_508dc47a","line":56,"in_reply_to":"1ae5cdf2_894bf385","updated":"2014-06-30 09:18:36.000000000","message":"Done","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8c4e882e141f5235e294235e37da127e844f460c","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        LOG.warn(utils.exception_to_str(e))"},{"line_number":60,"context_line":"    except store_api.UnsupportedBackend:"},{"line_number":61,"context_line":"        exc_type \u003d sys.exc_info()[0].__name__"},{"line_number":62,"context_line":"        msg \u003d (_(\u0027Failed to delete image %(image_id)s from store: %(exc)s\u0027) %"},{"line_number":63,"context_line":"               dict(image_id\u003dimage_id, exc\u003dexc_type))"},{"line_number":64,"context_line":"        LOG.error(msg)"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1ae5cdf2_095fe341","line":62,"updated":"2014-06-20 09:46:22.000000000","message":"_LE( ditto","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c96357ca90eff68d8121d28dc89ec5718749d231","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        LOG.warn(utils.exception_to_str(e))"},{"line_number":60,"context_line":"    except store_api.UnsupportedBackend:"},{"line_number":61,"context_line":"        exc_type \u003d sys.exc_info()[0].__name__"},{"line_number":62,"context_line":"        msg \u003d (_(\u0027Failed to delete image %(image_id)s from store: %(exc)s\u0027) %"},{"line_number":63,"context_line":"               dict(image_id\u003dimage_id, exc\u003dexc_type))"},{"line_number":64,"context_line":"        LOG.error(msg)"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_50e4e43a","line":62,"in_reply_to":"1ae5cdf2_095fe341","updated":"2014-06-30 09:18:36.000000000","message":"Done","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":39,"context_line":"CONF.register_opts(store_utils_opts)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def safe_delete_from_backend(context, image_id, location):"},{"line_number":43,"context_line":"    \"\"\""},{"line_number":44,"context_line":"    Given a location, delete an image from the store and"},{"line_number":45,"context_line":"    update location status to db."}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_085c8cec","line":42,"updated":"2014-07-03 15:34:57.000000000","message":"could you explain in the docstring why it is \"safe\"?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":39,"context_line":"CONF.register_opts(store_utils_opts)"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"def safe_delete_from_backend(context, image_id, location):"},{"line_number":43,"context_line":"    \"\"\""},{"line_number":44,"context_line":"    Given a location, delete an image from the store and"},{"line_number":45,"context_line":"    update location status to db."}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_195da315","line":42,"in_reply_to":"baada198_085c8cec","updated":"2014-07-04 07:58:46.000000000","message":"Done","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"def delete_image_location_from_backend(context, store_utils, image_id,"},{"line_number":101,"context_line":"                                       location):"},{"line_number":102,"context_line":"    deleted \u003d False"},{"line_number":103,"context_line":"    if CONF.delayed_delete:"},{"line_number":104,"context_line":"        deleted \u003d store_utils.schedule_delayed_delete_from_backend(context,"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_48f7648b","line":101,"updated":"2014-07-03 15:34:57.000000000","message":"could you add a docstring here?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"def delete_image_location_from_backend(context, store_utils, image_id,"},{"line_number":101,"context_line":"                                       location):"},{"line_number":102,"context_line":"    deleted \u003d False"},{"line_number":103,"context_line":"    if CONF.delayed_delete:"},{"line_number":104,"context_line":"        deleted \u003d store_utils.schedule_delayed_delete_from_backend(context,"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_399d07bd","line":101,"in_reply_to":"baada198_48f7648b","updated":"2014-07-04 07:58:46.000000000","message":"Done","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"}],"glance/db/__init__.py":[{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                url \u003d crypt.urlsafe_encrypt(key, l[\u0027url\u0027])"},{"line_number":128,"context_line":"                ld.append({\u0027url\u0027: url, \u0027metadata\u0027: l[\u0027metadata\u0027],"},{"line_number":129,"context_line":"                           \u0027status\u0027: l[\u0027status\u0027],"},{"line_number":130,"context_line":"                           # Note(zhiyan): New location has no ID field."},{"line_number":131,"context_line":"                           \u0027id\u0027: l.get(\u0027id\u0027)})"},{"line_number":132,"context_line":"            locations \u003d ld"},{"line_number":133,"context_line":"        return {"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn8A%3D","line":130,"updated":"2014-03-02 16:56:02.000000000","message":"(nit): NOTE?","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                url \u003d crypt.urlsafe_encrypt(key, l[\u0027url\u0027])"},{"line_number":128,"context_line":"                ld.append({\u0027url\u0027: url, \u0027metadata\u0027: l[\u0027metadata\u0027],"},{"line_number":129,"context_line":"                           \u0027status\u0027: l[\u0027status\u0027],"},{"line_number":130,"context_line":"                           # Note(zhiyan): New location has no ID field."},{"line_number":131,"context_line":"                           \u0027id\u0027: l.get(\u0027id\u0027)})"},{"line_number":132,"context_line":"            locations \u003d ld"},{"line_number":133,"context_line":"        return {"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxQc%3D","line":130,"in_reply_to":"AAAAVX%2F%2Fn8A%3D","updated":"2014-03-04 08:36:53.000000000","message":"Done","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            # NOTE(markwash) db api requires us to filter deleted"},{"line_number":92,"context_line":"            if not prop[\u0027deleted\u0027]:"},{"line_number":93,"context_line":"                properties[prop[\u0027name\u0027]] \u003d prop[\u0027value\u0027]"},{"line_number":94,"context_line":"        locations \u003d [l for l in db_image[\u0027locations\u0027]"},{"line_number":95,"context_line":"                     if l[\u0027status\u0027] \u003d\u003d \u0027active\u0027]"},{"line_number":96,"context_line":"        if CONF.metadata_encryption_key:"},{"line_number":97,"context_line":"            key \u003d CONF.metadata_encryption_key"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_88725c0f","line":94,"updated":"2014-07-03 15:34:57.000000000","message":"nit: would you mind replace l by loc","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            # NOTE(markwash) db api requires us to filter deleted"},{"line_number":92,"context_line":"            if not prop[\u0027deleted\u0027]:"},{"line_number":93,"context_line":"                properties[prop[\u0027name\u0027]] \u003d prop[\u0027value\u0027]"},{"line_number":94,"context_line":"        locations \u003d [l for l in db_image[\u0027locations\u0027]"},{"line_number":95,"context_line":"                     if l[\u0027status\u0027] \u003d\u003d \u0027active\u0027]"},{"line_number":96,"context_line":"        if CONF.metadata_encryption_key:"},{"line_number":97,"context_line":"            key \u003d CONF.metadata_encryption_key"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_59f0fbfd","line":94,"in_reply_to":"baada198_88725c0f","updated":"2014-07-04 07:58:46.000000000","message":"Done","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                ld.append({\u0027url\u0027: url, \u0027metadata\u0027: l[\u0027metadata\u0027],"},{"line_number":129,"context_line":"                           \u0027status\u0027: l[\u0027status\u0027],"},{"line_number":130,"context_line":"                           # NOTE(zhiyan): New location has no ID field."},{"line_number":131,"context_line":"                           \u0027id\u0027: l.get(\u0027id\u0027)})"},{"line_number":132,"context_line":"            locations \u003d ld"},{"line_number":133,"context_line":"        return {"},{"line_number":134,"context_line":"            \u0027id\u0027: image.image_id,"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_e89d980b","line":131,"updated":"2014-07-03 15:34:57.000000000","message":"same here: could you update the l to loc?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                ld.append({\u0027url\u0027: url, \u0027metadata\u0027: l[\u0027metadata\u0027],"},{"line_number":129,"context_line":"                           \u0027status\u0027: l[\u0027status\u0027],"},{"line_number":130,"context_line":"                           # NOTE(zhiyan): New location has no ID field."},{"line_number":131,"context_line":"                           \u0027id\u0027: l.get(\u0027id\u0027)})"},{"line_number":132,"context_line":"            locations \u003d ld"},{"line_number":133,"context_line":"        return {"},{"line_number":134,"context_line":"            \u0027id\u0027: image.image_id,"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_b9de776b","line":131,"in_reply_to":"baada198_e89d980b","updated":"2014-07-04 07:58:46.000000000","message":"Done","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"}],"glance/db/registry/api.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"@_get_client"},{"line_number":231,"context_line":"def image_location_delete(client, image_id, location_id, status, session\u003dNone):"},{"line_number":232,"context_line":"    \"\"\"Delete an image location.\"\"\""},{"line_number":233,"context_line":"    client.image_location_delete(image_id\u003dimage_id, location_id\u003dlocation_id,"},{"line_number":234,"context_line":"                                 status\u003dstatus)"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_2316d155","line":231,"updated":"2014-07-03 15:34:57.000000000","message":"I think the semantic here is not correct. I don\u0027t get why we want to have the status for an image_location_delete. That doesn\u0027t make sense to me.","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"@_get_client"},{"line_number":231,"context_line":"def image_location_delete(client, image_id, location_id, status, session\u003dNone):"},{"line_number":232,"context_line":"    \"\"\"Delete an image location.\"\"\""},{"line_number":233,"context_line":"    client.image_location_delete(image_id\u003dimage_id, location_id\u003dlocation_id,"},{"line_number":234,"context_line":"                                 status\u003dstatus)"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_b9b11791","line":231,"in_reply_to":"baada198_2316d155","updated":"2014-07-04 07:58:46.000000000","message":"Frankly, it\u0027s not truth, since scrubber needs a flag of location to determine which location under pending status even its \u0027deleted\u0027 flag equals \u0027True\u0027 (soft delete mechanism), that means scrubber only needs to execute deletion works for those pending_delete entries on backend store. This situation is very similar with image entry, the \u0027deleted\u0027 image entry also could under \u0027pending_delete\u0027 status with original glance delay_delete logic. So for this case, on db driver level, I need give location record (\u0027deleted\u0027 field equals \u0027True\u0027) a status to describe if its relevant image data has been deleted from backend store from glance\u0027s perspective, then scrubber could knows if it needs handle that location entry. The valid values for \u0027status\u0027 param are \u0027deleted\u0027 or \u0027pending_delete\u0027, and there\u0027s a check in its implementation.\n\nPing me if it still confuses you.","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"}],"glance/db/simple/api.py":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8c4e882e141f5235e294235e37da127e844f460c","unresolved":false,"context_lines":[{"line_number":518,"context_line":"                        \"updated_at\": delete_time,"},{"line_number":519,"context_line":"                        \"deleted_at\": delete_time})"},{"line_number":520,"context_line":"    if not deleted:"},{"line_number":521,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":522,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":523,"context_line":"        LOG.debug(msg)"},{"line_number":524,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1ae5cdf2_a42a967b","line":521,"updated":"2014-06-20 09:46:22.000000000","message":"No translations for debug messages.","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c96357ca90eff68d8121d28dc89ec5718749d231","unresolved":false,"context_lines":[{"line_number":518,"context_line":"                        \"updated_at\": delete_time,"},{"line_number":519,"context_line":"                        \"deleted_at\": delete_time})"},{"line_number":520,"context_line":"    if not deleted:"},{"line_number":521,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":522,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":523,"context_line":"        LOG.debug(msg)"},{"line_number":524,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_b012a060","line":521,"in_reply_to":"1ae5cdf2_a42a967b","updated":"2014-06-30 09:18:36.000000000","message":"Done","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":499,"context_line":"                        \"deleted\": deleted,"},{"line_number":500,"context_line":"                        \"updated_at\": updated_time,"},{"line_number":501,"context_line":"                        \"deleted_at\": delete_time})"},{"line_number":502,"context_line":"            break"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"@log_call"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_9e1532e7","line":502,"updated":"2014-07-03 15:34:57.000000000","message":"why don\u0027t we raise the same NotFound exception here (like we do in image_location_delete)?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":499,"context_line":"                        \"deleted\": deleted,"},{"line_number":500,"context_line":"                        \"updated_at\": updated_time,"},{"line_number":501,"context_line":"                        \"deleted_at\": delete_time})"},{"line_number":502,"context_line":"            break"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"@log_call"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_0beb8a13","line":502,"in_reply_to":"baada198_9e1532e7","updated":"2014-07-04 07:58:46.000000000","message":"Done","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":503,"context_line":""},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"@log_call"},{"line_number":506,"context_line":"def image_location_delete(context, image_id, location_id, status,"},{"line_number":507,"context_line":"                          delete_time\u003dNone):"},{"line_number":508,"context_line":"    if status not in (\u0027deleted\u0027, \u0027pending_delete\u0027):"},{"line_number":509,"context_line":"        msg \u003d _(\"The status of deleted image location can only be set to \""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_7eb77e3a","line":506,"updated":"2014-07-03 15:34:57.000000000","message":"I don\u0027t like to have status in the signature of a delete method.","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":503,"context_line":""},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"@log_call"},{"line_number":506,"context_line":"def image_location_delete(context, image_id, location_id, status,"},{"line_number":507,"context_line":"                          delete_time\u003dNone):"},{"line_number":508,"context_line":"    if status not in (\u0027deleted\u0027, \u0027pending_delete\u0027):"},{"line_number":509,"context_line":"        msg \u003d _(\"The status of deleted image location can only be set to \""}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_d9232bbb","line":506,"in_reply_to":"baada198_7eb77e3a","updated":"2014-07-04 07:58:46.000000000","message":"pls check my comments in https://review.openstack.org/#/c/67115/13/glance/db/registry/api.py","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":518,"context_line":"            loc.update({\"deleted\": deleted,"},{"line_number":519,"context_line":"                        \"status\": status,"},{"line_number":520,"context_line":"                        \"updated_at\": delete_time,"},{"line_number":521,"context_line":"                        \"deleted_at\": delete_time})"},{"line_number":522,"context_line":"    if not deleted:"},{"line_number":523,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":524,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_9ec37256","line":521,"updated":"2014-07-03 15:34:57.000000000","message":"don\u0027t you need to break here?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":518,"context_line":"            loc.update({\"deleted\": deleted,"},{"line_number":519,"context_line":"                        \"status\": status,"},{"line_number":520,"context_line":"                        \"updated_at\": delete_time,"},{"line_number":521,"context_line":"                        \"deleted_at\": delete_time})"},{"line_number":522,"context_line":"    if not deleted:"},{"line_number":523,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":524,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_ebb3b64a","line":521,"in_reply_to":"baada198_9ec37256","updated":"2014-07-04 07:58:46.000000000","message":"good catch","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":558,"context_line":"            del DATA[\u0027locations\u0027][i]"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"def _normalize_locations(image, force_show_deleted\u003dFalse):"},{"line_number":562,"context_line":"    if force_show_deleted:"},{"line_number":563,"context_line":"        locations \u003d image[\u0027locations\u0027]"},{"line_number":564,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_5ea2ba99","line":561,"updated":"2014-07-03 15:34:57.000000000","message":"tbh: I don\u0027t get what means _normalize_locations :) could you add a docstring?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":558,"context_line":"            del DATA[\u0027locations\u0027][i]"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"def _normalize_locations(image, force_show_deleted\u003dFalse):"},{"line_number":562,"context_line":"    if force_show_deleted:"},{"line_number":563,"context_line":"        locations \u003d image[\u0027locations\u0027]"},{"line_number":564,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_8bfa3abb","line":561,"in_reply_to":"baada198_5ea2ba99","updated":"2014-07-04 07:58:46.000000000","message":"Done, hope you like it :)","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"}],"glance/db/sqlalchemy/api.py":[{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"161e5e0a2f0bb93eb9d30b42fe02545fedfa17ed","unresolved":false,"context_lines":[{"line_number":142,"context_line":"def image_get(context, image_id, session\u003dNone, force_show_deleted\u003dFalse):"},{"line_number":143,"context_line":"    image \u003d _image_get(context, image_id, session\u003dsession,"},{"line_number":144,"context_line":"                       force_show_deleted\u003dforce_show_deleted)"},{"line_number":145,"context_line":"    image \u003d _normalize_locations(image.to_dict())"},{"line_number":146,"context_line":"    return image"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FroY%3D","side":"PARENT","line":145,"updated":"2014-03-04 18:27:15.000000000","message":"Is this change fixing a bug unrelated to the patch? It seems like the previous behavior was to ignore deleted locations even if the image is deleted. The new behavior is confusing, however, because its possible that we would be showing image locations that were deleted long before the image was deleted, so it does not give an accurate snapshot of the image at the time it was deleted.","commit_id":"bfddf66ec43442a9a69355635bc535ec4ae234f5"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b52d0638b84637680193e522d8ead4be64a80eb5","unresolved":false,"context_lines":[{"line_number":142,"context_line":"def image_get(context, image_id, session\u003dNone, force_show_deleted\u003dFalse):"},{"line_number":143,"context_line":"    image \u003d _image_get(context, image_id, session\u003dsession,"},{"line_number":144,"context_line":"                       force_show_deleted\u003dforce_show_deleted)"},{"line_number":145,"context_line":"    image \u003d _normalize_locations(image.to_dict())"},{"line_number":146,"context_line":"    return image"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2Fq6g%3D","side":"PARENT","line":145,"in_reply_to":"AAAAVn%2F%2FroY%3D","updated":"2014-03-04 18:52:46.000000000","message":"The key reason to me here is that we need to allow scrubber query those pending deleted locations within the deleted image.","commit_id":"bfddf66ec43442a9a69355635bc535ec4ae234f5"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"161e5e0a2f0bb93eb9d30b42fe02545fedfa17ed","unresolved":false,"context_lines":[{"line_number":718,"context_line":""},{"line_number":719,"context_line":""},{"line_number":720,"context_line":"def _image_locations_update(context, image_id, locations, session):"},{"line_number":721,"context_line":"    _image_locations_delete_all(context, image_id, session\u003dsession)"},{"line_number":722,"context_line":"    for loc in locations:"},{"line_number":723,"context_line":"        loc_id \u003d loc.get(\u0027id\u0027)"},{"line_number":724,"context_line":"        if loc_id is None:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2Fre8%3D","line":721,"updated":"2014-03-04 18:27:15.000000000","message":"The amount of work we\u0027re doing here to try to reset the image locations is distressing. Are we sure we need any \"image_locations_\" functions? It might be simpler and just as performant to stick with \"image_location_\" functions, i.e. functions that operate on a single location at a time.","commit_id":"1bb8cf064a8f3b0dba3b97702ce495d600f4397d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"3db8c5d2f95761e225a724cb762e6e164512e0be","unresolved":false,"context_lines":[{"line_number":718,"context_line":""},{"line_number":719,"context_line":""},{"line_number":720,"context_line":"def _image_locations_update(context, image_id, locations, session):"},{"line_number":721,"context_line":"    _image_locations_delete_all(context, image_id, session\u003dsession)"},{"line_number":722,"context_line":"    for loc in locations:"},{"line_number":723,"context_line":"        loc_id \u003d loc.get(\u0027id\u0027)"},{"line_number":724,"context_line":"        if loc_id is None:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FCW4%3D","line":721,"in_reply_to":"AAAAVn%2F%2Fre8%3D","updated":"2014-03-10 14:35:24.000000000","message":"Agreed, so in next PS:\n\n1. I added 4 DB API interfaces for image location: image_location_add/update/delete(), IMO base on those neat interfaces upper layer will easier to implements some image location functions.\n\n2. I still reserved _image_locations_set() and _image_locations_delete_all() function as DB API internal utils methods, those two functions only be used to improve code neatness, pls check the below comments and the code.\n\nthanks.","commit_id":"1bb8cf064a8f3b0dba3b97702ce495d600f4397d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"3db8c5d2f95761e225a724cb762e6e164512e0be","unresolved":false,"context_lines":[{"line_number":769,"context_line":"        raise exception.NotFound(msg)"},{"line_number":770,"context_line":""},{"line_number":771,"context_line":""},{"line_number":772,"context_line":"def _image_locations_delete_all(context, image_id, delete_time\u003dNone,"},{"line_number":773,"context_line":"                                session\u003dNone):"},{"line_number":774,"context_line":"    \"\"\"Delete all image locations for given image\"\"\""},{"line_number":775,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FEuo%3D","line":772,"updated":"2014-03-10 14:35:24.000000000","message":"@markwash, to followup your above comments: Can we reserve this function, since IMO it will make the code clearer if we put this stuff at here instead of put them at line #122 directly (it is the only one caller), and it could keep original function structure as well. And I agree, this function will reuse image_location_delete() but use own implementation in its internal. What do you think? thanks.\n\nFor the details pls check next PS.","commit_id":"1bb8cf064a8f3b0dba3b97702ce495d600f4397d"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8c4e882e141f5235e294235e37da127e844f460c","unresolved":false,"context_lines":[{"line_number":755,"context_line":"                             \"deleted_at\": delete_time})"},{"line_number":756,"context_line":"        location_ref.save(session\u003dsession)"},{"line_number":757,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":758,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":759,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":760,"context_line":"        LOG.debug(msg)"},{"line_number":761,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1ae5cdf2_64432e3f","line":758,"updated":"2014-06-20 09:46:22.000000000","message":"No translations for debug messages.","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c96357ca90eff68d8121d28dc89ec5718749d231","unresolved":false,"context_lines":[{"line_number":755,"context_line":"                             \"deleted_at\": delete_time})"},{"line_number":756,"context_line":"        location_ref.save(session\u003dsession)"},{"line_number":757,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":758,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":759,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":760,"context_line":"        LOG.debug(msg)"},{"line_number":761,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_30069021","line":758,"in_reply_to":"1ae5cdf2_64432e3f","updated":"2014-06-30 09:18:36.000000000","message":"Done","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8c4e882e141f5235e294235e37da127e844f460c","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                             \"deleted_at\": delete_time})"},{"line_number":784,"context_line":"        location_ref.save(session\u003dsession)"},{"line_number":785,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":786,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":787,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":788,"context_line":"        LOG.debug(msg)"},{"line_number":789,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1ae5cdf2_84759a99","line":786,"updated":"2014-06-20 09:46:22.000000000","message":"ditto","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c96357ca90eff68d8121d28dc89ec5718749d231","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                             \"deleted_at\": delete_time})"},{"line_number":784,"context_line":"        location_ref.save(session\u003dsession)"},{"line_number":785,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":786,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":787,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":788,"context_line":"        LOG.debug(msg)"},{"line_number":789,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_9b093d2f","line":786,"in_reply_to":"1ae5cdf2_84759a99","updated":"2014-06-30 09:18:36.000000000","message":"Done","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8c4e882e141f5235e294235e37da127e844f460c","unresolved":false,"context_lines":[{"line_number":803,"context_line":"            image_location_delete(context, image_id, loc_id, \u0027deleted\u0027,"},{"line_number":804,"context_line":"                                  session\u003dsession)"},{"line_number":805,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":806,"context_line":"        msg \u003d (_(\"No image found with ID %s\") % image_id)"},{"line_number":807,"context_line":"        LOG.debug(msg)"},{"line_number":808,"context_line":"        raise exception.NotFound(msg)"},{"line_number":809,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1ae5cdf2_a478d68f","line":806,"updated":"2014-06-20 09:46:22.000000000","message":"ditto","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c96357ca90eff68d8121d28dc89ec5718749d231","unresolved":false,"context_lines":[{"line_number":803,"context_line":"            image_location_delete(context, image_id, loc_id, \u0027deleted\u0027,"},{"line_number":804,"context_line":"                                  session\u003dsession)"},{"line_number":805,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":806,"context_line":"        msg \u003d (_(\"No image found with ID %s\") % image_id)"},{"line_number":807,"context_line":"        LOG.debug(msg)"},{"line_number":808,"context_line":"        raise exception.NotFound(msg)"},{"line_number":809,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_bb0e0133","line":806,"in_reply_to":"1ae5cdf2_a478d68f","updated":"2014-06-30 09:18:36.000000000","message":"Done","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8c4e882e141f5235e294235e37da127e844f460c","unresolved":false,"context_lines":[{"line_number":829,"context_line":"            image_location_delete(context, image_id, loc_id, \u0027deleted\u0027,"},{"line_number":830,"context_line":"                                  delete_time\u003ddelete_time, session\u003dsession)"},{"line_number":831,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":832,"context_line":"        msg \u003d (_(\"No image found with ID %s\") % image_id)"},{"line_number":833,"context_line":"        LOG.debug(msg)"},{"line_number":834,"context_line":"        raise exception.NotFound(msg)"},{"line_number":835,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1ae5cdf2_c46b22b7","line":832,"updated":"2014-06-20 09:46:22.000000000","message":"ditto","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c96357ca90eff68d8121d28dc89ec5718749d231","unresolved":false,"context_lines":[{"line_number":829,"context_line":"            image_location_delete(context, image_id, loc_id, \u0027deleted\u0027,"},{"line_number":830,"context_line":"                                  delete_time\u003ddelete_time, session\u003dsession)"},{"line_number":831,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":832,"context_line":"        msg \u003d (_(\"No image found with ID %s\") % image_id)"},{"line_number":833,"context_line":"        LOG.debug(msg)"},{"line_number":834,"context_line":"        raise exception.NotFound(msg)"},{"line_number":835,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_3b1af16e","line":832,"in_reply_to":"1ae5cdf2_c46b22b7","updated":"2014-06-30 09:18:36.000000000","message":"Done","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":8127,"name":"Alexander Tivelkov","email":"locher@yandex.ru","username":"ativelkov"},"change_message_id":"485685b1d805eaba2276ce8e896c7b2f7c5c335a","unresolved":false,"context_lines":[{"line_number":803,"context_line":"        for loc_id in [loc_ref.id for loc_ref in query.all()]:"},{"line_number":804,"context_line":"            image_location_delete(context, image_id, loc_id, \u0027deleted\u0027,"},{"line_number":805,"context_line":"                                  session\u003dsession)"},{"line_number":806,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":807,"context_line":"        msg \u003d _(\"No image found with ID %s\") % image_id"},{"line_number":808,"context_line":"        LOG.warn(msg)"},{"line_number":809,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_561dafbc","line":806,"updated":"2014-07-01 09:12:01.000000000","message":"What may cause this exceptions? query.all() does not raise NoResultFound, it just returns an empty list if there are not locations found","commit_id":"9f1f91f02f7e63135b3ae2d2988325e9ba118259"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"eb050f193591b2a4bcc88cc1d3b16f7a694595ad","unresolved":false,"context_lines":[{"line_number":803,"context_line":"        for loc_id in [loc_ref.id for loc_ref in query.all()]:"},{"line_number":804,"context_line":"            image_location_delete(context, image_id, loc_id, \u0027deleted\u0027,"},{"line_number":805,"context_line":"                                  session\u003dsession)"},{"line_number":806,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":807,"context_line":"        msg \u003d _(\"No image found with ID %s\") % image_id"},{"line_number":808,"context_line":"        LOG.warn(msg)"},{"line_number":809,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_9e13a00c","line":806,"in_reply_to":"baada198_561dafbc","updated":"2014-07-02 15:53:04.000000000","message":"Done","commit_id":"9f1f91f02f7e63135b3ae2d2988325e9ba118259"},{"author":{"_account_id":8127,"name":"Alexander Tivelkov","email":"locher@yandex.ru","username":"ativelkov"},"change_message_id":"485685b1d805eaba2276ce8e896c7b2f7c5c335a","unresolved":false,"context_lines":[{"line_number":829,"context_line":"        for loc_id in [loc_ref.id for loc_ref in location_refs]:"},{"line_number":830,"context_line":"            image_location_delete(context, image_id, loc_id, \u0027deleted\u0027,"},{"line_number":831,"context_line":"                                  delete_time\u003ddelete_time, session\u003dsession)"},{"line_number":832,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":833,"context_line":"        msg \u003d _(\"No image found with ID %s\") % image_id"},{"line_number":834,"context_line":"        LOG.warn(msg)"},{"line_number":835,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_f667a3e8","line":832,"updated":"2014-07-01 09:12:01.000000000","message":"Same as above","commit_id":"9f1f91f02f7e63135b3ae2d2988325e9ba118259"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"eb050f193591b2a4bcc88cc1d3b16f7a694595ad","unresolved":false,"context_lines":[{"line_number":829,"context_line":"        for loc_id in [loc_ref.id for loc_ref in location_refs]:"},{"line_number":830,"context_line":"            image_location_delete(context, image_id, loc_id, \u0027deleted\u0027,"},{"line_number":831,"context_line":"                                  delete_time\u003ddelete_time, session\u003dsession)"},{"line_number":832,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":833,"context_line":"        msg \u003d _(\"No image found with ID %s\") % image_id"},{"line_number":834,"context_line":"        LOG.warn(msg)"},{"line_number":835,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_bef944ca","line":832,"in_reply_to":"baada198_f667a3e8","updated":"2014-07-02 15:53:04.000000000","message":"Done","commit_id":"9f1f91f02f7e63135b3ae2d2988325e9ba118259"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    return _normalize_locations(image_ref)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"def _normalize_locations(image, force_show_deleted\u003dFalse):"},{"line_number":135,"context_line":"    if force_show_deleted:"},{"line_number":136,"context_line":"        locations \u003d image[\u0027locations\u0027]"},{"line_number":137,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_9ebff2a9","line":134,"updated":"2014-07-03 15:34:57.000000000","message":"same comment here: could you add a docstring to explain in which manner this is supposed to normalize?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    return _normalize_locations(image_ref)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"def _normalize_locations(image, force_show_deleted\u003dFalse):"},{"line_number":135,"context_line":"    if force_show_deleted:"},{"line_number":136,"context_line":"        locations \u003d image[\u0027locations\u0027]"},{"line_number":137,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_2b33eeab","line":134,"in_reply_to":"baada198_9ebff2a9","updated":"2014-07-04 07:58:46.000000000","message":"Done","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":756,"context_line":"                             \"deleted_at\": delete_time})"},{"line_number":757,"context_line":"        location_ref.save(session\u003dsession)"},{"line_number":758,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":759,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":760,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":761,"context_line":"        LOG.warn(msg)"},{"line_number":762,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_5e539a6a","line":759,"updated":"2014-07-03 15:34:57.000000000","message":"use excutils.save_and_reraise_exception ?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":756,"context_line":"                             \"deleted_at\": delete_time})"},{"line_number":757,"context_line":"        location_ref.save(session\u003dsession)"},{"line_number":758,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":759,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":760,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":761,"context_line":"        LOG.warn(msg)"},{"line_number":762,"context_line":"        raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_ee2e648b","line":759,"in_reply_to":"baada198_5e539a6a","updated":"2014-07-04 07:58:46.000000000","message":"I would say no, since we need to raise glance exception here instead of sqlalchemy exception.","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                             \"updated_at\": delete_time,"},{"line_number":784,"context_line":"                             \"deleted_at\": delete_time})"},{"line_number":785,"context_line":"        location_ref.save(session\u003dsession)"},{"line_number":786,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":787,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":788,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":789,"context_line":"        LOG.warn(msg)"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_3e56e65c","line":786,"updated":"2014-07-03 15:34:57.000000000","message":"use excutils.save_and_reraise_exception ?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":783,"context_line":"                             \"updated_at\": delete_time,"},{"line_number":784,"context_line":"                             \"deleted_at\": delete_time})"},{"line_number":785,"context_line":"        location_ref.save(session\u003dsession)"},{"line_number":786,"context_line":"    except sa_orm.exc.NoResultFound:"},{"line_number":787,"context_line":"        msg \u003d (_(\"No location found with ID %(loc)s from image %(img)s\") %"},{"line_number":788,"context_line":"               dict(loc\u003dlocation_id, img\u003dimage_id))"},{"line_number":789,"context_line":"        LOG.warn(msg)"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_2e54dcfd","line":786,"in_reply_to":"baada198_3e56e65c","updated":"2014-07-04 07:58:46.000000000","message":"ditto","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":815,"context_line":"                                delete_time\u003dNone, session\u003dNone):"},{"line_number":816,"context_line":"    \"\"\"Delete all image locations for given image\"\"\""},{"line_number":817,"context_line":"    session \u003d session or get_session()"},{"line_number":818,"context_line":"    location_refs \u003d session.query(models.ImageLocation)\\"},{"line_number":819,"context_line":"        .filter_by(image_id\u003dimage_id) \\"},{"line_number":820,"context_line":"        .filter_by(deleted\u003dFalse) \\"},{"line_number":821,"context_line":"        .all()"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_9eed32ba","line":818,"updated":"2014-07-03 15:34:57.000000000","message":"I think the OpenStack best practices recommend ( ) and not \\","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":815,"context_line":"                                delete_time\u003dNone, session\u003dNone):"},{"line_number":816,"context_line":"    \"\"\"Delete all image locations for given image\"\"\""},{"line_number":817,"context_line":"    session \u003d session or get_session()"},{"line_number":818,"context_line":"    location_refs \u003d session.query(models.ImageLocation)\\"},{"line_number":819,"context_line":"        .filter_by(image_id\u003dimage_id) \\"},{"line_number":820,"context_line":"        .filter_by(deleted\u003dFalse) \\"},{"line_number":821,"context_line":"        .all()"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_ae3f0cb3","line":818,"in_reply_to":"baada198_9eed32ba","updated":"2014-07-04 07:58:46.000000000","message":"Agreed, but currently I\u0027d more like to follow overall style with  other exiting codes in this module, and probably we can use a dedicated patch to do this?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"6858723fe5d38b55286fc82598a358ef2355fa37","unresolved":false,"context_lines":[{"line_number":752,"context_line":"            .one()"},{"line_number":753,"context_line":""},{"line_number":754,"context_line":"        deleted \u003d location[\u0027status\u0027] in (\u0027deleted\u0027, \u0027pending_delete\u0027)"},{"line_number":755,"context_line":"        updated_time \u003d timeutils.utcnow()"},{"line_number":756,"context_line":"        delete_time \u003d updated_time if deleted else None"},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"        location_ref.update({\"value\": location[\u0027url\u0027],"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_5b8d13d2","line":755,"updated":"2014-07-09 16:17:15.000000000","message":"timeutils.isotime?","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":752,"context_line":"            .one()"},{"line_number":753,"context_line":""},{"line_number":754,"context_line":"        deleted \u003d location[\u0027status\u0027] in (\u0027deleted\u0027, \u0027pending_delete\u0027)"},{"line_number":755,"context_line":"        updated_time \u003d timeutils.utcnow()"},{"line_number":756,"context_line":"        delete_time \u003d updated_time if deleted else None"},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"        location_ref.update({\"value\": location[\u0027url\u0027],"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_619f1a04","line":755,"in_reply_to":"baada198_5b8d13d2","updated":"2014-07-10 10:48:39.000000000","message":"timeutils.isotime() returns string instead of datetime.datetime, and IMO, making the DB datetime data (and its type) be consistent will be better [0]. pls let me know if I miss-understand your point.\n\n[0] https://github.com/openstack/glance/blob/master/glance/db/sqlalchemy/models.py#L85","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"1d0258151e1e5b983b015c9a8d57eac5453c9e76","unresolved":false,"context_lines":[{"line_number":752,"context_line":"            .one()"},{"line_number":753,"context_line":""},{"line_number":754,"context_line":"        deleted \u003d location[\u0027status\u0027] in (\u0027deleted\u0027, \u0027pending_delete\u0027)"},{"line_number":755,"context_line":"        updated_time \u003d timeutils.utcnow()"},{"line_number":756,"context_line":"        delete_time \u003d updated_time if deleted else None"},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"        location_ref.update({\"value\": location[\u0027url\u0027],"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_4d8792d7","line":755,"in_reply_to":"baada198_619f1a04","updated":"2014-07-10 21:42:14.000000000","message":"Think you\u0027r right! \n\nWas thinking that the representation of time needed some timezone info (from an old keystone client bug) http://stackoverflow.com/questions/2331592/datetime-datetime-utcnow-why-no-tzinfo\n\nGuess, we use utcnow everywhere else. So this looks good.","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"}],"glance/gateway.py":[{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"b60b239374d52a5c89378b9181dd0ecc80e60987","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    def get_image_factory(self, context):"},{"line_number":40,"context_line":"        image_factory \u003d glance.domain.ImageFactory()"},{"line_number":41,"context_line":"        store_image_factory \u003d glance.location.ImageFactoryProxy("},{"line_number":42,"context_line":"            image_factory, context, self.store_api, self.store_utils)"},{"line_number":43,"context_line":"        quota_image_factory \u003d glance.quota.ImageFactoryProxy("},{"line_number":44,"context_line":"            store_image_factory, context, self.db_api, self.store_utils)"},{"line_number":45,"context_line":"        policy_image_factory \u003d policy.ImageFactoryProxy("}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_dc1521e6","line":42,"updated":"2014-07-10 15:21:53.000000000","message":"a minor style thing: do we really need to add store_utils as an arg here? It\u0027s just a set of regular functions, so do we need to treat it in this special way? Should the delete operation just continue to live in \u0027store_api\u0027?","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"bbc4ef4358ed345ac921b49a582d34c523f79037","unresolved":false,"context_lines":[{"line_number":39,"context_line":"    def get_image_factory(self, context):"},{"line_number":40,"context_line":"        image_factory \u003d glance.domain.ImageFactory()"},{"line_number":41,"context_line":"        store_image_factory \u003d glance.location.ImageFactoryProxy("},{"line_number":42,"context_line":"            image_factory, context, self.store_api, self.store_utils)"},{"line_number":43,"context_line":"        quota_image_factory \u003d glance.quota.ImageFactoryProxy("},{"line_number":44,"context_line":"            store_image_factory, context, self.db_api, self.store_utils)"},{"line_number":45,"context_line":"        policy_image_factory \u003d policy.ImageFactoryProxy("}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_bf2f623d","line":42,"in_reply_to":"baada198_dc1521e6","updated":"2014-07-11 05:43:51.000000000","message":"Let my make a response at here for your this kind of issue.\n\nActually we (Mark, John and me) had talked this before, the root cause of this style is that the answer of question \"Should the delete operation just continue to live in \u0027store_api\u0027?\" is No (sorry), the key reason is that we don\u0027t like to make the relationship between store module/code with db api module/code (importing db layer in store layer), so I use store_utils to make a higher abstraction (and we agreed), it leverages functions from store and db both modules.\n\nLet me know if it confused you.","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"b60b239374d52a5c89378b9181dd0ecc80e60987","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        store_image_factory \u003d glance.location.ImageFactoryProxy("},{"line_number":42,"context_line":"            image_factory, context, self.store_api, self.store_utils)"},{"line_number":43,"context_line":"        quota_image_factory \u003d glance.quota.ImageFactoryProxy("},{"line_number":44,"context_line":"            store_image_factory, context, self.db_api, self.store_utils)"},{"line_number":45,"context_line":"        policy_image_factory \u003d policy.ImageFactoryProxy("},{"line_number":46,"context_line":"            quota_image_factory, context, self.policy)"},{"line_number":47,"context_line":"        notifier_image_factory \u003d glance.notifier.ImageFactoryProxy("}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_3cd29dd2","line":44,"updated":"2014-07-10 15:21:53.000000000","message":"Here too I wonder if adding store_utils \"looks right\"?\n\nIn the existing glance/quota/__init__.py where we currently need to access common, non-specific store functionality (eg glance.store.get_size_from_backend) we haven\u0027t needed to add an argument here. If the new delete functions lived in \u0027store_api\u0027 then we could continue to just do glance.store.\u003cwhichever delete func\u003e which would be consistent with what we do with get_size_from_backend","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"b60b239374d52a5c89378b9181dd0ecc80e60987","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def get_image_member_factory(self, context):"},{"line_number":62,"context_line":"        image_factory \u003d glance.domain.ImageMemberFactory()"},{"line_number":63,"context_line":"        quota_image_factory \u003d glance.quota.ImageMemberFactoryProxy("},{"line_number":64,"context_line":"            image_factory, context, self.db_api, self.store_utils)"},{"line_number":65,"context_line":"        policy_member_factory \u003d policy.ImageMemberFactoryProxy("},{"line_number":66,"context_line":"            quota_image_factory, context, self.policy)"},{"line_number":67,"context_line":"        authorized_image_factory \u003d authorization.ImageMemberFactoryProxy("}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_bcaa2d17","line":64,"updated":"2014-07-10 15:21:53.000000000","message":"same","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"b60b239374d52a5c89378b9181dd0ecc80e60987","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    def get_repo(self, context):"},{"line_number":72,"context_line":"        image_repo \u003d glance.db.ImageRepo(context, self.db_api)"},{"line_number":73,"context_line":"        store_image_repo \u003d glance.location.ImageRepoProxy("},{"line_number":74,"context_line":"            image_repo, context, self.store_api, self.store_utils)"},{"line_number":75,"context_line":"        quota_image_repo \u003d glance.quota.ImageRepoProxy("},{"line_number":76,"context_line":"            store_image_repo, context, self.db_api, self.store_utils)"},{"line_number":77,"context_line":"        policy_image_repo \u003d policy.ImageRepoProxy("}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_dca52148","line":74,"updated":"2014-07-10 15:21:53.000000000","message":"same","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"b60b239374d52a5c89378b9181dd0ecc80e60987","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        store_image_repo \u003d glance.location.ImageRepoProxy("},{"line_number":74,"context_line":"            image_repo, context, self.store_api, self.store_utils)"},{"line_number":75,"context_line":"        quota_image_repo \u003d glance.quota.ImageRepoProxy("},{"line_number":76,"context_line":"            store_image_repo, context, self.db_api, self.store_utils)"},{"line_number":77,"context_line":"        policy_image_repo \u003d policy.ImageRepoProxy("},{"line_number":78,"context_line":"            quota_image_repo, context, self.policy)"},{"line_number":79,"context_line":"        notifier_image_repo \u003d glance.notifier.ImageRepoProxy("}],"source_content_type":"text/x-python","patch_set":15,"id":"baada198_1c679926","line":76,"updated":"2014-07-10 15:21:53.000000000","message":"same","commit_id":"e0013516cc0b4399a553c89ec51fbbc71c8aef9c"}],"glance/location.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"95445d855d0e5bcd7c777a17786fd4d8cf8d4988","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                break"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def _calc_duplicated_location(locations, new):"},{"line_number":103,"context_line":"    ret \u003d 0"},{"line_number":104,"context_line":"    for loc in locations:"},{"line_number":105,"context_line":"        if (loc[\u0027url\u0027] \u003d\u003d new[\u0027url\u0027] and loc[\u0027metadata\u0027] \u003d\u003d new[\u0027metadata\u0027]):"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_9ee0d297","line":102,"updated":"2014-07-03 15:34:57.000000000","message":"could you add a docstring?\n\nwhat about renaming to _count_duplicated_locations(..)?","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"1af260f1d2a49e081b1b64bccacafdb7d2630792","unresolved":false,"context_lines":[{"line_number":99,"context_line":"                break"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def _calc_duplicated_location(locations, new):"},{"line_number":103,"context_line":"    ret \u003d 0"},{"line_number":104,"context_line":"    for loc in locations:"},{"line_number":105,"context_line":"        if (loc[\u0027url\u0027] \u003d\u003d new[\u0027url\u0027] and loc[\u0027metadata\u0027] \u003d\u003d new[\u0027metadata\u0027]):"}],"source_content_type":"text/x-python","patch_set":13,"id":"baada198_6ecdf4b6","line":102,"in_reply_to":"baada198_9ee0d297","updated":"2014-07-04 07:58:46.000000000","message":"Sure.","commit_id":"e9ae452f55ef6596e3cba755cbb9789514bc7f69"}],"glance/registry/client/v1/client.py":[{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"f30d9b9af5cbce61174427601fd1c22ba7272506","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                            self.metadata_encryption_key, loc[\u0027url\u0027], 64)"},{"line_number":82,"context_line":"                    ld.append({\u0027url\u0027: url, \u0027metadata\u0027: loc[\u0027metadata\u0027],"},{"line_number":83,"context_line":"                               \u0027status\u0027: loc[\u0027status\u0027],"},{"line_number":84,"context_line":"                               # Note(zhiyan): New location has no ID field."},{"line_number":85,"context_line":"                               \u0027id\u0027: loc.get(\u0027id\u0027)})"},{"line_number":86,"context_line":"                image_metadata[\u0027location_data\u0027] \u003d ld"},{"line_number":87,"context_line":"        return image_metadata"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVX%2F%2Fn7o%3D","line":84,"updated":"2014-03-02 16:56:02.000000000","message":"(nit): NOTE","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b354c4c55962243f38dda468023f538e93b3ef81","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                            self.metadata_encryption_key, loc[\u0027url\u0027], 64)"},{"line_number":82,"context_line":"                    ld.append({\u0027url\u0027: url, \u0027metadata\u0027: loc[\u0027metadata\u0027],"},{"line_number":83,"context_line":"                               \u0027status\u0027: loc[\u0027status\u0027],"},{"line_number":84,"context_line":"                               # Note(zhiyan): New location has no ID field."},{"line_number":85,"context_line":"                               \u0027id\u0027: loc.get(\u0027id\u0027)})"},{"line_number":86,"context_line":"                image_metadata[\u0027location_data\u0027] \u003d ld"},{"line_number":87,"context_line":"        return image_metadata"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FxQQ%3D","line":84,"in_reply_to":"AAAAVX%2F%2Fn7o%3D","updated":"2014-03-04 08:36:53.000000000","message":"Done","commit_id":"7502fffdba04f45c476e9162aa9fd955083ec692"}],"glance/scrubber.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright 2010 OpenStack Foundation"},{"line_number":4,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL24%3D","line":1,"updated":"2014-02-15 02:32:00.000000000","message":"you can remove this","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright 2010 OpenStack Foundation"},{"line_number":4,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6WE%3D","line":1,"in_reply_to":"AAAAUX%2F%2FL24%3D","updated":"2014-02-18 08:57:59.000000000","message":"Done","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"}],"glance/store/__init__.py":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"8c4e882e141f5235e294235e37da127e844f460c","unresolved":false,"context_lines":[{"line_number":719,"context_line":"                                          \u0027err\u0027: utils.exception_to_str(e)})"},{"line_number":720,"context_line":"                err \u003d e"},{"line_number":721,"context_line":"        # tried all locations"},{"line_number":722,"context_line":"        LOG.error(_(\u0027Glance tried all active locations to get data for \u0027"},{"line_number":723,"context_line":"                    \u0027image %s but all have failed.\u0027) % self.image.image_id)"},{"line_number":724,"context_line":"        raise err"},{"line_number":725,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1ae5cdf2_c4c7a296","line":722,"updated":"2014-06-20 09:46:22.000000000","message":"I think this is ok for now for consistency. Will change it later while working on the logging.","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c96357ca90eff68d8121d28dc89ec5718749d231","unresolved":false,"context_lines":[{"line_number":719,"context_line":"                                          \u0027err\u0027: utils.exception_to_str(e)})"},{"line_number":720,"context_line":"                err \u003d e"},{"line_number":721,"context_line":"        # tried all locations"},{"line_number":722,"context_line":"        LOG.error(_(\u0027Glance tried all active locations to get data for \u0027"},{"line_number":723,"context_line":"                    \u0027image %s but all have failed.\u0027) % self.image.image_id)"},{"line_number":724,"context_line":"        raise err"},{"line_number":725,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_fb3dd9bc","line":722,"in_reply_to":"1ae5cdf2_c4c7a296","updated":"2014-06-30 09:18:36.000000000","message":"Done","commit_id":"906e56e9f6c5932f4e27a66839deefda68cd1e07"}],"glance/tests/functional/db/base.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":217,"context_line":"                     {\u0027url\u0027: \u0027b\u0027, \u0027metadata\u0027: {}, \u0027status\u0027: \u0027active\u0027}]"},{"line_number":218,"context_line":"        fixture \u003d {\u0027locations\u0027: locations}"},{"line_number":219,"context_line":"        image \u003d self.db_api.image_update(self.adm_context, UUID3, fixture)"},{"line_number":220,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":221,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":222,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":223,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_46bf9eaa","line":220,"updated":"2014-07-09 21:17:19.000000000","message":"please see my comments below for the next 2 lines as well","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":217,"context_line":"                     {\u0027url\u0027: \u0027b\u0027, \u0027metadata\u0027: {}, \u0027status\u0027: \u0027active\u0027}]"},{"line_number":218,"context_line":"        fixture \u003d {\u0027locations\u0027: locations}"},{"line_number":219,"context_line":"        image \u003d self.db_api.image_update(self.adm_context, UUID3, fixture)"},{"line_number":220,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":221,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":222,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":223,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_c1062621","line":220,"in_reply_to":"baada198_46bf9eaa","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                         {\u0027url\u0027: \u0027b\u0027, \u0027metadata\u0027: {}, \u0027status\u0027: \u0027active\u0027}]"},{"line_number":231,"context_line":"        fixture \u003d {\u0027locations\u0027: location_data}"},{"line_number":232,"context_line":"        image \u003d self.db_api.image_update(self.adm_context, UUID3, fixture)"},{"line_number":233,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":234,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":235,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":236,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_c69c8e60","line":233,"updated":"2014-07-09 21:17:19.000000000","message":"same as 768","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                         {\u0027url\u0027: \u0027b\u0027, \u0027metadata\u0027: {}, \u0027status\u0027: \u0027active\u0027}]"},{"line_number":231,"context_line":"        fixture \u003d {\u0027locations\u0027: location_data}"},{"line_number":232,"context_line":"        image \u003d self.db_api.image_update(self.adm_context, UUID3, fixture)"},{"line_number":233,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":234,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":235,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":236,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_813eeed8","line":233,"in_reply_to":"baada198_c69c8e60","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        fixture \u003d {\u0027locations\u0027: location_data}"},{"line_number":232,"context_line":"        image \u003d self.db_api.image_update(self.adm_context, UUID3, fixture)"},{"line_number":233,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":234,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":235,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":236,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"},{"line_number":237,"context_line":"        image[\u0027locations\u0027][1].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_86b9b6cd","line":234,"updated":"2014-07-09 21:17:19.000000000","message":"as in 769","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":231,"context_line":"        fixture \u003d {\u0027locations\u0027: location_data}"},{"line_number":232,"context_line":"        image \u003d self.db_api.image_update(self.adm_context, UUID3, fixture)"},{"line_number":233,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":234,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":235,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":236,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"},{"line_number":237,"context_line":"        image[\u0027locations\u0027][1].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_a124d2c6","line":234,"in_reply_to":"baada198_86b9b6cd","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        image \u003d self.db_api.image_update(self.adm_context, UUID3, fixture)"},{"line_number":233,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":234,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":235,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":236,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"},{"line_number":237,"context_line":"        image[\u0027locations\u0027][1].pop(\u0027id\u0027)"},{"line_number":238,"context_line":"        self.assertEqual(location_data, image[\u0027locations\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_e6c9925b","line":235,"updated":"2014-07-09 21:17:19.000000000","message":"ditto","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        image \u003d self.db_api.image_update(self.adm_context, UUID3, fixture)"},{"line_number":233,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":234,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":235,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":236,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"},{"line_number":237,"context_line":"        image[\u0027locations\u0027][1].pop(\u0027id\u0027)"},{"line_number":238,"context_line":"        self.assertEqual(location_data, image[\u0027locations\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_e12ecaa4","line":235,"in_reply_to":"baada198_e6c9925b","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":765,"context_line":"        member \u003d self.db_api.image_member_create(self.context, fixture)"},{"line_number":766,"context_line":"        self.db_api.image_tag_create(self.context, IMG_ID, \u0027snarf\u0027)"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":769,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":770,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":771,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_66a102a9","line":768,"updated":"2014-07-09 21:17:19.000000000","message":"self.assertEqual(expected, observed)","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":765,"context_line":"        member \u003d self.db_api.image_member_create(self.context, fixture)"},{"line_number":766,"context_line":"        self.db_api.image_tag_create(self.context, IMG_ID, \u0027snarf\u0027)"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":769,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":770,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":771,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_414db698","line":768,"in_reply_to":"baada198_66a102a9","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":766,"context_line":"        self.db_api.image_tag_create(self.context, IMG_ID, \u0027snarf\u0027)"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":769,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":770,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":771,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"},{"line_number":772,"context_line":"        image[\u0027locations\u0027][1].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_86929649","line":769,"updated":"2014-07-09 21:17:19.000000000","message":"can we use self.assertIn() here?","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":766,"context_line":"        self.db_api.image_tag_create(self.context, IMG_ID, \u0027snarf\u0027)"},{"line_number":767,"context_line":""},{"line_number":768,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":769,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":770,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":771,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"},{"line_number":772,"context_line":"        image[\u0027locations\u0027][1].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_0153be39","line":769,"in_reply_to":"baada198_86929649","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":767,"context_line":""},{"line_number":768,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":769,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":770,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":771,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"},{"line_number":772,"context_line":"        image[\u0027locations\u0027][1].pop(\u0027id\u0027)"},{"line_number":773,"context_line":"        self.assertEqual(location_data, image[\u0027locations\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_a6995a70","line":770,"updated":"2014-07-09 21:17:19.000000000","message":"ditto","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":767,"context_line":""},{"line_number":768,"context_line":"        self.assertEqual(len(image[\u0027locations\u0027]), 2)"},{"line_number":769,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][0])"},{"line_number":770,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027locations\u0027][1])"},{"line_number":771,"context_line":"        image[\u0027locations\u0027][0].pop(\u0027id\u0027)"},{"line_number":772,"context_line":"        image[\u0027locations\u0027][1].pop(\u0027id\u0027)"},{"line_number":773,"context_line":"        self.assertEqual(location_data, image[\u0027locations\u0027])"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_4134d6fa","line":770,"in_reply_to":"baada198_a6995a70","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"}],"glance/tests/unit/test_db.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                              locations\u003dencrypted_locations)"},{"line_number":403,"context_line":"        self.db.image_create(None, db_data)"},{"line_number":404,"context_line":"        image \u003d self.image_repo.get(UUID1)"},{"line_number":405,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[0])"},{"line_number":406,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[1])"},{"line_number":407,"context_line":"        image.locations[0].pop(\u0027id\u0027)"},{"line_number":408,"context_line":"        image.locations[1].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_e6d0b2f9","line":405,"updated":"2014-07-09 21:17:19.000000000","message":"assertIn","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                              locations\u003dencrypted_locations)"},{"line_number":403,"context_line":"        self.db.image_create(None, db_data)"},{"line_number":404,"context_line":"        image \u003d self.image_repo.get(UUID1)"},{"line_number":405,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[0])"},{"line_number":406,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[1])"},{"line_number":407,"context_line":"        image.locations[0].pop(\u0027id\u0027)"},{"line_number":408,"context_line":"        image.locations[1].pop(\u0027id\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_6c20f19b","line":405,"in_reply_to":"baada198_e6d0b2f9","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":403,"context_line":"        self.db.image_create(None, db_data)"},{"line_number":404,"context_line":"        image \u003d self.image_repo.get(UUID1)"},{"line_number":405,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[0])"},{"line_number":406,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[1])"},{"line_number":407,"context_line":"        image.locations[0].pop(\u0027id\u0027)"},{"line_number":408,"context_line":"        image.locations[1].pop(\u0027id\u0027)"},{"line_number":409,"context_line":"        self.assertEqual(image.locations, orig_locations)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_06ccc660","line":406,"updated":"2014-07-09 21:17:19.000000000","message":"ditto","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":403,"context_line":"        self.db.image_create(None, db_data)"},{"line_number":404,"context_line":"        image \u003d self.image_repo.get(UUID1)"},{"line_number":405,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[0])"},{"line_number":406,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[1])"},{"line_number":407,"context_line":"        image.locations[0].pop(\u0027id\u0027)"},{"line_number":408,"context_line":"        image.locations[1].pop(\u0027id\u0027)"},{"line_number":409,"context_line":"        self.assertEqual(image.locations, orig_locations)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_8c2385a6","line":406,"in_reply_to":"baada198_06ccc660","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        self.db.image_create(None, db_data)"},{"line_number":423,"context_line":"        image \u003d self.image_repo.list()[0]"},{"line_number":424,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[0])"},{"line_number":425,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[1])"},{"line_number":426,"context_line":"        image.locations[0].pop(\u0027id\u0027)"},{"line_number":427,"context_line":"        image.locations[1].pop(\u0027id\u0027)"},{"line_number":428,"context_line":"        self.assertEqual(image.locations, orig_locations)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_46d6bef2","line":425,"updated":"2014-07-09 21:17:19.000000000","message":"ditto","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"629155c93f86b204905efbbdb6006d6bbab266be","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        self.db.image_create(None, db_data)"},{"line_number":423,"context_line":"        image \u003d self.image_repo.list()[0]"},{"line_number":424,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[0])"},{"line_number":425,"context_line":"        self.assertTrue(\u0027id\u0027 in image.locations[1])"},{"line_number":426,"context_line":"        image.locations[0].pop(\u0027id\u0027)"},{"line_number":427,"context_line":"        image.locations[1].pop(\u0027id\u0027)"},{"line_number":428,"context_line":"        self.assertEqual(image.locations, orig_locations)"}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_ac3929da","line":425,"in_reply_to":"baada198_46d6bef2","updated":"2014-07-10 10:48:39.000000000","message":"Done","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"}],"glance/tests/unit/utils.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2362d4c4d31c1cf4079f84110721014bd159de19","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        return getattr(simple_db, key)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"class FakeStoreUtils(object):"},{"line_number":95,"context_line":"    def __init__(self, store_api):"},{"line_number":96,"context_line":"        self.store_api \u003d store_api"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"baada198_46e07e96","line":94,"updated":"2014-07-09 21:17:19.000000000","message":"do we need this class or can we use the original class and mock our the necessary methods whenever imported?\n\nSeems like you might have introduced those changes in this Merge Prop anyways so, might be a good place to avoid addition of this class.","commit_id":"6f067f8a7c4fdad50ace53326649bb489ce2fc7d"}],"glance/tests/unit/v1/test_registry_api.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":1788,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":1789,"context_line":"        res_dict \u003d jsonutils.loads(res.body)"},{"line_number":1790,"context_line":"        image \u003d res_dict[\u0027image\u0027]"},{"line_number":1791,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027location_data\u0027][0])"},{"line_number":1792,"context_line":"        image[\u0027location_data\u0027][0].pop(\u0027id\u0027)"},{"line_number":1793,"context_line":"        self.assertEqual(self.FIXTURES[0][\u0027locations\u0027][0],"},{"line_number":1794,"context_line":"                         image[\u0027location_data\u0027][0])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL2c%3D","line":1791,"updated":"2014-02-15 02:32:00.000000000","message":"assertIn","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":1788,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":1789,"context_line":"        res_dict \u003d jsonutils.loads(res.body)"},{"line_number":1790,"context_line":"        image \u003d res_dict[\u0027image\u0027]"},{"line_number":1791,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027location_data\u0027][0])"},{"line_number":1792,"context_line":"        image[\u0027location_data\u0027][0].pop(\u0027id\u0027)"},{"line_number":1793,"context_line":"        self.assertEqual(self.FIXTURES[0][\u0027locations\u0027][0],"},{"line_number":1794,"context_line":"                         image[\u0027location_data\u0027][0])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6Vo%3D","line":1791,"in_reply_to":"AAAAUX%2F%2FL2c%3D","updated":"2014-02-18 08:57:59.000000000","message":"Done","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"b35d7725677de33411517745d31cc38e0151c10d","unresolved":false,"context_lines":[{"line_number":1803,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":1804,"context_line":"        res_dict \u003d jsonutils.loads(res.body)"},{"line_number":1805,"context_line":"        image \u003d res_dict[\u0027image\u0027]"},{"line_number":1806,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027location_data\u0027][0])"},{"line_number":1807,"context_line":"        image[\u0027location_data\u0027][0].pop(\u0027id\u0027)"},{"line_number":1808,"context_line":"        self.assertEqual(self.FIXTURES[1][\u0027locations\u0027][0],"},{"line_number":1809,"context_line":"                         image[\u0027location_data\u0027][0])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2FL2g%3D","line":1806,"updated":"2014-02-15 02:32:00.000000000","message":"assertIn","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"8368128c1c51c310f17dd885af234ce4761f6e3a","unresolved":false,"context_lines":[{"line_number":1803,"context_line":"        self.assertEqual(res.status_int, 200)"},{"line_number":1804,"context_line":"        res_dict \u003d jsonutils.loads(res.body)"},{"line_number":1805,"context_line":"        image \u003d res_dict[\u0027image\u0027]"},{"line_number":1806,"context_line":"        self.assertTrue(\u0027id\u0027 in image[\u0027location_data\u0027][0])"},{"line_number":1807,"context_line":"        image[\u0027location_data\u0027][0].pop(\u0027id\u0027)"},{"line_number":1808,"context_line":"        self.assertEqual(self.FIXTURES[1][\u0027locations\u0027][0],"},{"line_number":1809,"context_line":"                         image[\u0027location_data\u0027][0])"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUX%2F%2B6Vk%3D","line":1806,"in_reply_to":"AAAAUX%2F%2FL2g%3D","updated":"2014-02-18 08:57:59.000000000","message":"Done","commit_id":"fb53710107f06a75017754c97395e6846b33ba47"}]}
