)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding store location proxy to domain"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adding a proxy layer to image for take care its locations for the store:"},{"line_number":10,"context_line":"1. Image location correctness checking"},{"line_number":11,"context_line":"2. Remove image data from the store when a location is removed from an"},{"line_number":12,"context_line":"image"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAAPn%2F%2Fa9U%3D","line":9,"updated":"2013-07-02 10:56:08.000000000","message":"s/for take/to take/\n\ns/care its/care of it\u0027s/","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding store location proxy to domain"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adding a proxy layer to image for take care its locations for the store:"},{"line_number":10,"context_line":"1. Image location correctness checking"},{"line_number":11,"context_line":"2. Remove image data from the store when a location is removed from an"},{"line_number":12,"context_line":"image"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAAPn%2F%2FX2Y%3D","line":9,"in_reply_to":"AAAAPn%2F%2Fa9U%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"}],"glance/store/__init__.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        return result"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"def _check_location_uri(context, store_api, uri, existing\u003dTrue):"},{"line_number":349,"context_line":"    is_ok \u003d False"},{"line_number":350,"context_line":"    try:"},{"line_number":351,"context_line":"        size \u003d store_api.get_size_from_backend(context, uri)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiGw%3D","line":348,"updated":"2013-06-28 12:27:04.000000000","message":"Hey :)\n\nRegardless it\u0027s a private function, I\u0027d prefer having some docs here.\n\ns/existing/exists/ ?","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        return result"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"def _check_location_uri(context, store_api, uri, existing\u003dTrue):"},{"line_number":349,"context_line":"    is_ok \u003d False"},{"line_number":350,"context_line":"    try:"},{"line_number":351,"context_line":"        size \u003d store_api.get_size_from_backend(context, uri)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ff2c%3D","line":348,"in_reply_to":"AAAAPn%2F%2FiGw%3D","updated":"2013-06-29 08:26:49.000000000","message":"Done","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":346,"context_line":""},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"def _check_location_uri(context, store_api, uri, existing\u003dTrue):"},{"line_number":349,"context_line":"    is_ok \u003d False"},{"line_number":350,"context_line":"    try:"},{"line_number":351,"context_line":"        size \u003d store_api.get_size_from_backend(context, uri)"},{"line_number":352,"context_line":"        # Some stores return zero when it catch exception"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiGY%3D","line":349,"updated":"2013-06-28 12:27:04.000000000","message":"I think the example bellow could work and would remove some extra code from other areas:\n\nis_ok \u003d not existing","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":346,"context_line":""},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"def _check_location_uri(context, store_api, uri, existing\u003dTrue):"},{"line_number":349,"context_line":"    is_ok \u003d False"},{"line_number":350,"context_line":"    try:"},{"line_number":351,"context_line":"        size \u003d store_api.get_size_from_backend(context, uri)"},{"line_number":352,"context_line":"        # Some stores return zero when it catch exception"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ff2I%3D","line":349,"in_reply_to":"AAAAPn%2F%2FiGY%3D","updated":"2013-06-29 08:26:49.000000000","message":"maybe your change can remove some code, but under my thoughts current code logic could keep maximum clear.","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":349,"context_line":"    is_ok \u003d False"},{"line_number":350,"context_line":"    try:"},{"line_number":351,"context_line":"        size \u003d store_api.get_size_from_backend(context, uri)"},{"line_number":352,"context_line":"        # Some stores return zero when it catch exception"},{"line_number":353,"context_line":"        is_ok \u003d not existing or size \u003e 0"},{"line_number":354,"context_line":"    except exception.UnknownScheme:"},{"line_number":355,"context_line":"        is_ok \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiGo%3D","line":352,"updated":"2013-06-28 12:27:04.000000000","message":"pls, add NOTE(username)","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":349,"context_line":"    is_ok \u003d False"},{"line_number":350,"context_line":"    try:"},{"line_number":351,"context_line":"        size \u003d store_api.get_size_from_backend(context, uri)"},{"line_number":352,"context_line":"        # Some stores return zero when it catch exception"},{"line_number":353,"context_line":"        is_ok \u003d not existing or size \u003e 0"},{"line_number":354,"context_line":"    except exception.UnknownScheme:"},{"line_number":355,"context_line":"        is_ok \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ff2Y%3D","line":352,"in_reply_to":"AAAAPn%2F%2FiGo%3D","updated":"2013-06-29 08:26:49.000000000","message":"Done","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":382,"context_line":"        return super(ImageFactoryProxy, self).new_image(**kwargs)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"class StoreLocations(collections.MutableSequence):"},{"line_number":386,"context_line":"    def __init__(self, image_proxy, value):"},{"line_number":387,"context_line":"        self.image_proxy \u003d image_proxy"},{"line_number":388,"context_line":"        if isinstance(value, list):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiFw%3D","line":385,"updated":"2013-06-28 12:27:04.000000000","message":"pls, document this class","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":382,"context_line":"        return super(ImageFactoryProxy, self).new_image(**kwargs)"},{"line_number":383,"context_line":""},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"class StoreLocations(collections.MutableSequence):"},{"line_number":386,"context_line":"    def __init__(self, image_proxy, value):"},{"line_number":387,"context_line":"        self.image_proxy \u003d image_proxy"},{"line_number":388,"context_line":"        if isinstance(value, list):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ff18%3D","line":385,"in_reply_to":"AAAAPn%2F%2FiFw%3D","updated":"2013-06-29 08:26:49.000000000","message":"Done","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":457,"context_line":"            uri \u003d self.value.__getitem__(i)"},{"line_number":458,"context_line":"        except:"},{"line_number":459,"context_line":"            return self.value.__delitem__(i)"},{"line_number":460,"context_line":"        _delete_image_from_backend(self.image_proxy.context,"},{"line_number":461,"context_line":"                                   self.image_proxy.store_api,"},{"line_number":462,"context_line":"                                   self.image_proxy.image.image_id,"},{"line_number":463,"context_line":"                                   uri)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiE8%3D","line":460,"updated":"2013-06-28 12:27:04.000000000","message":"mmhh, I don\u0027t like the idea of deleting the image here. Seems harmful. Could you please elaborate more the use case?","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":457,"context_line":"            uri \u003d self.value.__getitem__(i)"},{"line_number":458,"context_line":"        except:"},{"line_number":459,"context_line":"            return self.value.__delitem__(i)"},{"line_number":460,"context_line":"        _delete_image_from_backend(self.image_proxy.context,"},{"line_number":461,"context_line":"                                   self.image_proxy.store_api,"},{"line_number":462,"context_line":"                                   self.image_proxy.image.image_id,"},{"line_number":463,"context_line":"                                   uri)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ff1s%3D","line":460,"in_reply_to":"AAAAPn%2F%2FiE8%3D","updated":"2013-06-29 08:26:49.000000000","message":"flavio87, for this hook, i just try to make \u0027del\u0027 operation on image.location like \u0027remove\u0027 operation on it. client code for image object could use remove() to delete a location and its image content from backend and also could use \u0027del\u0027 built-in function to that. just like a native python list object supported.\n\nOr, could you pls tell me the harmful you concered?","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":513,"context_line":"        raise NotImplemented()"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":""},{"line_number":516,"context_line":"def _locations_proxy(target, attr):"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    def get_attr(self):"},{"line_number":519,"context_line":"        value \u003d getattr(getattr(self, target), attr)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiFk%3D","line":516,"updated":"2013-06-28 12:27:04.000000000","message":"pls, document","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":513,"context_line":"        raise NotImplemented()"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":""},{"line_number":516,"context_line":"def _locations_proxy(target, attr):"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"    def get_attr(self):"},{"line_number":519,"context_line":"        value \u003d getattr(getattr(self, target), attr)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ff1c%3D","line":516,"in_reply_to":"AAAAPn%2F%2FiFk%3D","updated":"2013-06-29 08:26:49.000000000","message":"Done","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":521,"context_line":""},{"line_number":522,"context_line":"    def set_attr(self, value):"},{"line_number":523,"context_line":"        # Check locations are all valid."},{"line_number":524,"context_line":"        if value.__class__ not in (list, StoreLocations):"},{"line_number":525,"context_line":"            raise exception.BadStoreUri(_(\u0027Invalid locations: %s\u0027) % value)"},{"line_number":526,"context_line":"        elif isinstance(value, StoreLocations):"},{"line_number":527,"context_line":"            for uri in value.value:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiFc%3D","line":524,"updated":"2013-06-28 12:27:04.000000000","message":"Why not check if it is instance?\n\nisinstance(value, (list, StoreLocations))","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":521,"context_line":""},{"line_number":522,"context_line":"    def set_attr(self, value):"},{"line_number":523,"context_line":"        # Check locations are all valid."},{"line_number":524,"context_line":"        if value.__class__ not in (list, StoreLocations):"},{"line_number":525,"context_line":"            raise exception.BadStoreUri(_(\u0027Invalid locations: %s\u0027) % value)"},{"line_number":526,"context_line":"        elif isinstance(value, StoreLocations):"},{"line_number":527,"context_line":"            for uri in value.value:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ff1U%3D","line":524,"in_reply_to":"AAAAPn%2F%2FiFc%3D","updated":"2013-06-29 08:26:49.000000000","message":"Done","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        # Check locations are all valid."},{"line_number":524,"context_line":"        if value.__class__ not in (list, StoreLocations):"},{"line_number":525,"context_line":"            raise exception.BadStoreUri(_(\u0027Invalid locations: %s\u0027) % value)"},{"line_number":526,"context_line":"        elif isinstance(value, StoreLocations):"},{"line_number":527,"context_line":"            for uri in value.value:"},{"line_number":528,"context_line":"                _check_location_uri(self.context, self.store_api, uri)"},{"line_number":529,"context_line":"            return setattr(getattr(self, target), attr, value.value)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiFQ%3D","line":526,"updated":"2013-06-28 12:27:04.000000000","message":"This clause and else\u0027s do the same. Why not making StoreLocations iterable? The code example bellow should be enough.\n\ndef __iter__(self, ...):\n    return iter(self.value)","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        # Check locations are all valid."},{"line_number":524,"context_line":"        if value.__class__ not in (list, StoreLocations):"},{"line_number":525,"context_line":"            raise exception.BadStoreUri(_(\u0027Invalid locations: %s\u0027) % value)"},{"line_number":526,"context_line":"        elif isinstance(value, StoreLocations):"},{"line_number":527,"context_line":"            for uri in value.value:"},{"line_number":528,"context_line":"                _check_location_uri(self.context, self.store_api, uri)"},{"line_number":529,"context_line":"            return setattr(getattr(self, target), attr, value.value)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ffzk%3D","line":526,"in_reply_to":"AAAAPn%2F%2FiFQ%3D","updated":"2013-06-29 08:26:49.000000000","message":"Done","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":534,"context_line":""},{"line_number":535,"context_line":"    def del_attr(self):"},{"line_number":536,"context_line":"        value \u003d getattr(getattr(self, target), attr)"},{"line_number":537,"context_line":"        tmp \u003d copy.copy(value)"},{"line_number":538,"context_line":"        for uri in value:"},{"line_number":539,"context_line":"            _delete_image_from_backend(self.context, self.store_api,"},{"line_number":540,"context_line":"                                       self.image.image_id, uri)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiFE%3D","line":537,"updated":"2013-06-28 12:27:04.000000000","message":"could you please add a Note why you need to copy value ?","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":534,"context_line":""},{"line_number":535,"context_line":"    def del_attr(self):"},{"line_number":536,"context_line":"        value \u003d getattr(getattr(self, target), attr)"},{"line_number":537,"context_line":"        tmp \u003d copy.copy(value)"},{"line_number":538,"context_line":"        for uri in value:"},{"line_number":539,"context_line":"            _delete_image_from_backend(self.context, self.store_api,"},{"line_number":540,"context_line":"                                       self.image.image_id, uri)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FfzU%3D","line":537,"in_reply_to":"AAAAPn%2F%2FiFE%3D","updated":"2013-06-29 08:26:49.000000000","message":"Done","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":563,"context_line":"                member_repo_proxy_kwargs\u003dproxy_kwargs)"},{"line_number":564,"context_line":""},{"line_number":565,"context_line":"    def delete(self):"},{"line_number":566,"context_line":"        self.image.delete()"},{"line_number":567,"context_line":"        if self.image.locations:"},{"line_number":568,"context_line":"            if CONF.delayed_delete:"},{"line_number":569,"context_line":"                self.image.status \u003d \u0027pending_delete\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiEs%3D","line":566,"updated":"2013-06-28 12:27:04.000000000","message":"should we use _delete_image_from_backend here?","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":563,"context_line":"                member_repo_proxy_kwargs\u003dproxy_kwargs)"},{"line_number":564,"context_line":""},{"line_number":565,"context_line":"    def delete(self):"},{"line_number":566,"context_line":"        self.image.delete()"},{"line_number":567,"context_line":"        if self.image.locations:"},{"line_number":568,"context_line":"            if CONF.delayed_delete:"},{"line_number":569,"context_line":"                self.image.status \u003d \u0027pending_delete\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ffyg%3D","line":566,"in_reply_to":"AAAAPn%2F%2FiEs%3D","updated":"2013-06-29 08:26:49.000000000","message":"Done","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":360,"context_line":"    :param context: Glance request context"},{"line_number":361,"context_line":"    :param store_api: store API module"},{"line_number":362,"context_line":"    :param uri: location\u0027s uri string"},{"line_number":363,"context_line":"    :param exists: check the location must exists"},{"line_number":364,"context_line":"    \"\"\""},{"line_number":365,"context_line":"    is_ok \u003d False"},{"line_number":366,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2Fa9I%3D","line":363,"updated":"2013-07-02 10:56:08.000000000","message":"s/must exists/should exist/","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":360,"context_line":"    :param context: Glance request context"},{"line_number":361,"context_line":"    :param store_api: store API module"},{"line_number":362,"context_line":"    :param uri: location\u0027s uri string"},{"line_number":363,"context_line":"    :param exists: check the location must exists"},{"line_number":364,"context_line":"    \"\"\""},{"line_number":365,"context_line":"    is_ok \u003d False"},{"line_number":366,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXvU%3D","line":363,"in_reply_to":"AAAAPn%2F%2Fa9I%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":392,"context_line":""},{"line_number":393,"context_line":"class StoreLocations(collections.MutableSequence):"},{"line_number":394,"context_line":"    \"\"\""},{"line_number":395,"context_line":"    The proxy for store location property. It take responsibility for:"},{"line_number":396,"context_line":"    1. Location uri correctness checking when a new loction add to the image."},{"line_number":397,"context_line":"    2. Remove the image data from the store when a location is removed"},{"line_number":398,"context_line":"       from an image."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2Fa9A%3D","line":395,"updated":"2013-07-02 10:56:08.000000000","message":"s/take/takes/","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":392,"context_line":""},{"line_number":393,"context_line":"class StoreLocations(collections.MutableSequence):"},{"line_number":394,"context_line":"    \"\"\""},{"line_number":395,"context_line":"    The proxy for store location property. It take responsibility for:"},{"line_number":396,"context_line":"    1. Location uri correctness checking when a new loction add to the image."},{"line_number":397,"context_line":"    2. Remove the image data from the store when a location is removed"},{"line_number":398,"context_line":"       from an image."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXvQ%3D","line":395,"in_reply_to":"AAAAPn%2F%2Fa9A%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":393,"context_line":"class StoreLocations(collections.MutableSequence):"},{"line_number":394,"context_line":"    \"\"\""},{"line_number":395,"context_line":"    The proxy for store location property. It take responsibility for:"},{"line_number":396,"context_line":"    1. Location uri correctness checking when a new loction add to the image."},{"line_number":397,"context_line":"    2. Remove the image data from the store when a location is removed"},{"line_number":398,"context_line":"       from an image."},{"line_number":399,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2Fa8s%3D","line":396,"updated":"2013-07-02 10:56:08.000000000","message":"s/when a new loction add/when adding a new location/","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":393,"context_line":"class StoreLocations(collections.MutableSequence):"},{"line_number":394,"context_line":"    \"\"\""},{"line_number":395,"context_line":"    The proxy for store location property. It take responsibility for:"},{"line_number":396,"context_line":"    1. Location uri correctness checking when a new loction add to the image."},{"line_number":397,"context_line":"    2. Remove the image data from the store when a location is removed"},{"line_number":398,"context_line":"       from an image."},{"line_number":399,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXvI%3D","line":396,"in_reply_to":"AAAAPn%2F%2Fa8s%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":438,"context_line":"                                      uri)"},{"line_number":439,"context_line":"        except Exception as e:"},{"line_number":440,"context_line":"            self.value.insert(i, uri)"},{"line_number":441,"context_line":"            raise e"},{"line_number":442,"context_line":"        return uri"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"    def count(self, uri):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FbBw%3D","line":441,"updated":"2013-07-02 10:56:08.000000000","message":"I think this should be just \"raise\", to preseve the traceback (ref 41cc89af)","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":438,"context_line":"                                      uri)"},{"line_number":439,"context_line":"        except Exception as e:"},{"line_number":440,"context_line":"            self.value.insert(i, uri)"},{"line_number":441,"context_line":"            raise e"},{"line_number":442,"context_line":"        return uri"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"    def count(self, uri):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXuk%3D","line":441,"in_reply_to":"AAAAPn%2F%2FbBw%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":473,"context_line":"        uri \u003d None"},{"line_number":474,"context_line":"        try:"},{"line_number":475,"context_line":"            uri \u003d self.value.__getitem__(i)"},{"line_number":476,"context_line":"        except:"},{"line_number":477,"context_line":"            return self.value.__delitem__(i)"},{"line_number":478,"context_line":"        delete_image_from_backend(self.image_proxy.context,"},{"line_number":479,"context_line":"                                  self.image_proxy.store_api,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FbBg%3D","line":476,"updated":"2013-07-02 10:56:08.000000000","message":"From HACKING.rst, \"Do not write \"except:\", use \"except Exception:\" at the very least\"","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":473,"context_line":"        uri \u003d None"},{"line_number":474,"context_line":"        try:"},{"line_number":475,"context_line":"            uri \u003d self.value.__getitem__(i)"},{"line_number":476,"context_line":"        except:"},{"line_number":477,"context_line":"            return self.value.__delitem__(i)"},{"line_number":478,"context_line":"        delete_image_from_backend(self.image_proxy.context,"},{"line_number":479,"context_line":"                                  self.image_proxy.store_api,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXu4%3D","line":476,"in_reply_to":"AAAAPn%2F%2FbBg%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":487,"context_line":"        uris \u003d []"},{"line_number":488,"context_line":"        try:"},{"line_number":489,"context_line":"            uris \u003d self.value.__getslice__(i, j)"},{"line_number":490,"context_line":"        except:"},{"line_number":491,"context_line":"            return self.value.__delslice__(i, j)"},{"line_number":492,"context_line":"        for uri in uris:"},{"line_number":493,"context_line":"            delete_image_from_backend(self.image_proxy.context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FbBY%3D","line":490,"updated":"2013-07-02 10:56:08.000000000","message":"Same","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":487,"context_line":"        uris \u003d []"},{"line_number":488,"context_line":"        try:"},{"line_number":489,"context_line":"            uris \u003d self.value.__getslice__(i, j)"},{"line_number":490,"context_line":"        except:"},{"line_number":491,"context_line":"            return self.value.__delslice__(i, j)"},{"line_number":492,"context_line":"        for uri in uris:"},{"line_number":493,"context_line":"            delete_image_from_backend(self.image_proxy.context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXu0%3D","line":490,"in_reply_to":"AAAAPn%2F%2FbBY%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":535,"context_line":"    \"\"\""},{"line_number":536,"context_line":"    Make a location property proxy on the image object."},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    :param target: the image object proxy want make"},{"line_number":539,"context_line":"    :param attr: the property proxy want to hook"},{"line_number":540,"context_line":"    \"\"\""},{"line_number":541,"context_line":"    def get_attr(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2Fa7g%3D","line":538,"updated":"2013-07-02 10:56:08.000000000","message":"s/proxy want make/on which to add the proxy/","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":535,"context_line":"    \"\"\""},{"line_number":536,"context_line":"    Make a location property proxy on the image object."},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    :param target: the image object proxy want make"},{"line_number":539,"context_line":"    :param attr: the property proxy want to hook"},{"line_number":540,"context_line":"    \"\"\""},{"line_number":541,"context_line":"    def get_attr(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXuw%3D","line":538,"in_reply_to":"AAAAPn%2F%2Fa7g%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":536,"context_line":"    Make a location property proxy on the image object."},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    :param target: the image object proxy want make"},{"line_number":539,"context_line":"    :param attr: the property proxy want to hook"},{"line_number":540,"context_line":"    \"\"\""},{"line_number":541,"context_line":"    def get_attr(self):"},{"line_number":542,"context_line":"        value \u003d getattr(getattr(self, target), attr)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2Fa7U%3D","line":539,"updated":"2013-07-02 10:56:08.000000000","message":"s/want to/we want to/","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":536,"context_line":"    Make a location property proxy on the image object."},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"    :param target: the image object proxy want make"},{"line_number":539,"context_line":"    :param attr: the property proxy want to hook"},{"line_number":540,"context_line":"    \"\"\""},{"line_number":541,"context_line":"    def get_attr(self):"},{"line_number":542,"context_line":"        value \u003d getattr(getattr(self, target), attr)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXus%3D","line":539,"in_reply_to":"AAAAPn%2F%2Fa7U%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":557,"context_line":"        # deleting and cause image locations property not consistent with"},{"line_number":558,"context_line":"        # backend stored. So in the loop I will update the temporary list"},{"line_number":559,"context_line":"        # on each time and update image locations property if the location"},{"line_number":560,"context_line":"        # removing successful."},{"line_number":561,"context_line":"        tmp \u003d copy.copy(value)"},{"line_number":562,"context_line":"        for uri in value:"},{"line_number":563,"context_line":"            delete_image_from_backend(self.context, self.store_api,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2Fa7w%3D","line":560,"updated":"2013-07-02 10:56:08.000000000","message":"It might be worth revisiting this note?  It doesn\u0027t make sense to me why you\u0027re using copy to handle a potential exception rather than just try/except","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":557,"context_line":"        # deleting and cause image locations property not consistent with"},{"line_number":558,"context_line":"        # backend stored. So in the loop I will update the temporary list"},{"line_number":559,"context_line":"        # on each time and update image locations property if the location"},{"line_number":560,"context_line":"        # removing successful."},{"line_number":561,"context_line":"        tmp \u003d copy.copy(value)"},{"line_number":562,"context_line":"        for uri in value:"},{"line_number":563,"context_line":"            delete_image_from_backend(self.context, self.store_api,"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXrk%3D","line":560,"in_reply_to":"AAAAPn%2F%2Fa7w%3D","updated":"2013-07-03 06:34:05.000000000","message":"Done","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"61e81b61c611aac2a468360653392153f32157c4","unresolved":false,"context_lines":[{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import collections"},{"line_number":19,"context_line":"import copy"},{"line_number":20,"context_line":"import os"},{"line_number":21,"context_line":"import sys"},{"line_number":22,"context_line":"import time"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FXAM%3D","line":19,"updated":"2013-07-03 11:14:15.000000000","message":"I think the copy import can be removed now.","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"f2f68e981dc1e961201f5b0431018d974e3cae9b","unresolved":false,"context_lines":[{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import collections"},{"line_number":19,"context_line":"import copy"},{"line_number":20,"context_line":"import os"},{"line_number":21,"context_line":"import sys"},{"line_number":22,"context_line":"import time"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FUdk%3D","line":19,"in_reply_to":"AAAAPn%2F%2FXAM%3D","updated":"2013-07-04 03:16:16.000000000","message":"will remove this in next ps.","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"f8f79c5f79da152775bacfd306b48081e4937941","unresolved":false,"context_lines":[{"line_number":298,"context_line":""},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"def delete_image_from_backend(context, store_api, image_id, uri):"},{"line_number":301,"context_line":"    if uri:"},{"line_number":302,"context_line":"        if CONF.delayed_delete:"},{"line_number":303,"context_line":"            store_api.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":304,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FS54%3D","line":301,"updated":"2013-07-04 17:51:10.000000000","message":"I don\u0027t understand this conditional. It seems like it should be an error to specify a delete for an empty uri.","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5937a8cd43dffc1b822dec71a58b89bcec499406","unresolved":false,"context_lines":[{"line_number":298,"context_line":""},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"def delete_image_from_backend(context, store_api, image_id, uri):"},{"line_number":301,"context_line":"    if uri:"},{"line_number":302,"context_line":"        if CONF.delayed_delete:"},{"line_number":303,"context_line":"            store_api.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":304,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSg8%3D","line":301,"in_reply_to":"AAAAPn%2F%2FS54%3D","updated":"2013-07-05 03:10:54.000000000","message":"Done","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"f8f79c5f79da152775bacfd306b48081e4937941","unresolved":false,"context_lines":[{"line_number":353,"context_line":"        return result"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"def _check_location_uri(context, store_api, uri, exists\u003dTrue):"},{"line_number":357,"context_line":"    \"\"\""},{"line_number":358,"context_line":"    Check if an image location uri is valid."},{"line_number":359,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FS5s%3D","line":356,"updated":"2013-07-04 17:51:10.000000000","message":"I don\u0027t think existence is optional here.","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5937a8cd43dffc1b822dec71a58b89bcec499406","unresolved":false,"context_lines":[{"line_number":353,"context_line":"        return result"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"def _check_location_uri(context, store_api, uri, exists\u003dTrue):"},{"line_number":357,"context_line":"    \"\"\""},{"line_number":358,"context_line":"    Check if an image location uri is valid."},{"line_number":359,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSgw%3D","line":356,"in_reply_to":"AAAAPn%2F%2FS5s%3D","updated":"2013-07-05 03:10:54.000000000","message":"Done","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"f8f79c5f79da152775bacfd306b48081e4937941","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    def new_image(self, **kwargs):"},{"line_number":388,"context_line":"        for uri in kwargs.get(\u0027locations\u0027, []):"},{"line_number":389,"context_line":"            _check_location_uri(self.context, self.store_api, uri, False)"},{"line_number":390,"context_line":"        return super(ImageFactoryProxy, self).new_image(**kwargs)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FS5I%3D","line":389,"updated":"2013-07-04 17:51:10.000000000","message":"I think the semantics here are wrong. If you create an image and  it is already loaded with location uris, we want to ensure that those uris already exist. So basically I think we should have \"exists\u003dTrue\" here.","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5937a8cd43dffc1b822dec71a58b89bcec499406","unresolved":false,"context_lines":[{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    def new_image(self, **kwargs):"},{"line_number":388,"context_line":"        for uri in kwargs.get(\u0027locations\u0027, []):"},{"line_number":389,"context_line":"            _check_location_uri(self.context, self.store_api, uri, False)"},{"line_number":390,"context_line":"        return super(ImageFactoryProxy, self).new_image(**kwargs)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSgs%3D","line":389,"in_reply_to":"AAAAPn%2F%2FS5I%3D","updated":"2013-07-05 03:10:54.000000000","message":"Done","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"f8f79c5f79da152775bacfd306b48081e4937941","unresolved":false,"context_lines":[{"line_number":399,"context_line":"    \"\"\""},{"line_number":400,"context_line":"    def __init__(self, image_proxy, value):"},{"line_number":401,"context_line":"        self.image_proxy \u003d image_proxy"},{"line_number":402,"context_line":"        if isinstance(value, list):"},{"line_number":403,"context_line":"            self.value \u003d value"},{"line_number":404,"context_line":"        else:"},{"line_number":405,"context_line":"            self.value \u003d list(value)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FS40%3D","line":402,"updated":"2013-07-04 17:51:10.000000000","message":"I think this check is not needed. Calling list(list(foo)) is not substantial overhead on top of calling list(foo). So better to write this as\n\n  def __init__(self, image_proxy, value):\n      self.image_proxy \u003d image_proxy\n      self.value \u003d list(value)","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5937a8cd43dffc1b822dec71a58b89bcec499406","unresolved":false,"context_lines":[{"line_number":399,"context_line":"    \"\"\""},{"line_number":400,"context_line":"    def __init__(self, image_proxy, value):"},{"line_number":401,"context_line":"        self.image_proxy \u003d image_proxy"},{"line_number":402,"context_line":"        if isinstance(value, list):"},{"line_number":403,"context_line":"            self.value \u003d value"},{"line_number":404,"context_line":"        else:"},{"line_number":405,"context_line":"            self.value \u003d list(value)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSgk%3D","line":402,"in_reply_to":"AAAAPn%2F%2FS40%3D","updated":"2013-07-05 03:10:54.000000000","message":"Yes, for the python grammar this comment is right, thanks. But in the context here, we should not always call \u0027list()\u0027, since it will make a new copy of the \u0027value\u0027 object here, that is glance.domain.Image or glance.tests.unit.test_store_image.ImageStub object, the copy convert by the \u0027list()\u0027 will cause we lose all the changes this class did on the \u0027locations\u0027 field of the proxied Image domain object, the changes just be performed on the local list object but not outside referenced \u0027locations\u0027 list.","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"f8f79c5f79da152775bacfd306b48081e4937941","unresolved":false,"context_lines":[{"line_number":412,"context_line":"    def extend(self, other):"},{"line_number":413,"context_line":"        if isinstance(other, StoreLocations):"},{"line_number":414,"context_line":"            self.value.extend(other.value)"},{"line_number":415,"context_line":"        elif isinstance(other, type(self.value)):"},{"line_number":416,"context_line":"            for uri in other:"},{"line_number":417,"context_line":"                _check_location_uri(self.image_proxy.context,"},{"line_number":418,"context_line":"                                    self.image_proxy.store_api, uri)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FS4U%3D","line":415,"updated":"2013-07-04 17:51:10.000000000","message":"This elif seems to exist to avoid casting a list to a list. As above, I\u0027m pretty sure casting a list to a list is a trivial operation, so I\u0027d rather avoid the complexity this elif entirely in favor of just following the logic in the \"else\" block.","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5937a8cd43dffc1b822dec71a58b89bcec499406","unresolved":false,"context_lines":[{"line_number":412,"context_line":"    def extend(self, other):"},{"line_number":413,"context_line":"        if isinstance(other, StoreLocations):"},{"line_number":414,"context_line":"            self.value.extend(other.value)"},{"line_number":415,"context_line":"        elif isinstance(other, type(self.value)):"},{"line_number":416,"context_line":"            for uri in other:"},{"line_number":417,"context_line":"                _check_location_uri(self.image_proxy.context,"},{"line_number":418,"context_line":"                                    self.image_proxy.store_api, uri)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2FSgM%3D","line":415,"in_reply_to":"AAAAPn%2F%2FS4U%3D","updated":"2013-07-05 03:10:54.000000000","message":"Done. This change is fine, I have also changed __iadd__().","commit_id":"78c433a9baf0ce3b0d4a0fa03313fc0323532820"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"10596764abc98b7a60b956fc29f91c5800380522","unresolved":false,"context_lines":[{"line_number":394,"context_line":"    \"\"\""},{"line_number":395,"context_line":"    def __init__(self, image_proxy, value):"},{"line_number":396,"context_line":"        self.image_proxy \u003d image_proxy"},{"line_number":397,"context_line":"        if isinstance(value, list):"},{"line_number":398,"context_line":"            self.value \u003d value"},{"line_number":399,"context_line":"        else:"},{"line_number":400,"context_line":"            self.value \u003d list(value)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2F%2FNY%3D","line":397,"updated":"2013-07-07 17:54:51.000000000","message":"Your note about avoiding casting a list to a list to preserve original references seemed mistaken to me, so I tried it out. Please see the attached interactive python terminal session. Or maybe I missed your point? In the session below, you can see that list(list(a)) only makes copies of the reference to the underlying objects--it does not make copies of the objects themselves.\n\n  \u003e\u003e\u003e class Foo(object):\n  ...     def __init__(self, foo):\n  ...             self.foo \u003d foo\n  ...\n  ...     def __repr__(self):\n  ...             return str(self.foo)\n  ...\n  \u003e\u003e\u003e a \u003d [Foo(1), Foo(2), Foo(3)]\n  \u003e\u003e\u003e a\n  [1, 2, 3]\n  \u003e\u003e\u003e b \u003d list(a)\n  \u003e\u003e\u003e c \u003d list(list(a))\n  \u003e\u003e\u003e b\n  [1, 2, 3]\n  \u003e\u003e\u003e c\n  [1, 2, 3]\n  \u003e\u003e\u003e c.append(Foo(4))\n  \u003e\u003e\u003e a\n  [1, 2, 3]\n  \u003e\u003e\u003e b\n  [1, 2, 3]\n  \u003e\u003e\u003e c\n  [1, 2, 3, 4]\n  \u003e\u003e\u003e c[0].foo \u003d -1\n  \u003e\u003e\u003e a\n  [-1, 2, 3]\n  \u003e\u003e\u003e b\n  [-1, 2, 3]\n  \u003e\u003e\u003e c\n  [-1, 2, 3, 4]\n  \u003e\u003e\u003e b.append(Foo(5))\n  \u003e\u003e\u003e b\n  [-1, 2, 3, 5]\n  \u003e\u003e\u003e c\n  [-1, 2, 3, 4]\n  \u003e\u003e\u003e a\n  [-1, 2, 3]\n  \u003e\u003e\u003e a[1].foo \u003d -1\n  \u003e\u003e\u003e a\n  [-1, -1, 3]\n  \u003e\u003e\u003e b\n  [-1, -1, 3, 5]\n  \u003e\u003e\u003e c\n  [-1, -1, 3, 4]","commit_id":"ef21fe1b4fcbdc11b7499f6e7c28fe26753adf02"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"469ab049a61c4e407338218b89e12bd0933d3715","unresolved":false,"context_lines":[{"line_number":394,"context_line":"    \"\"\""},{"line_number":395,"context_line":"    def __init__(self, image_proxy, value):"},{"line_number":396,"context_line":"        self.image_proxy \u003d image_proxy"},{"line_number":397,"context_line":"        if isinstance(value, list):"},{"line_number":398,"context_line":"            self.value \u003d value"},{"line_number":399,"context_line":"        else:"},{"line_number":400,"context_line":"            self.value \u003d list(value)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2F%2B%2BY%3D","line":397,"in_reply_to":"AAAAP3%2F%2F%2FNY%3D","updated":"2013-07-08 03:45:04.000000000","message":"You are correct Mark, but it seems we are saying different situation, let me clarify. The \u0027value\u0027 (parameter, local variable here) is a list which contains some \u0027location\u0027 strings/directories (as \u0027a\u0027 in your demo), the code \u0027self.value \u003d list(value)\u0027 will creata a replicated new list, and \u0027self.value\u0027 refer it (as \u0027b\u0027 in your demo). In this class there are some methods will do some changes to \u0027self.value\u0027 as following, such as \u0027append\u0027, \u0027extend\u0027, \u0027insert\u0027 and etc. , those changes are all performed to the replicated list \u0027self.value\u0027, but not \u0027value\u0027 (local variable here), this caused all changes lost for the proxied /real/ locations list which refered by ImageProxy object, this logic just like your demo did:\n\n\n  \u003e\u003e\u003e a                           \u003c\u003c\u003d\u003d As \u0027value\u0027 parameter, local variable\n  [-1, 2, 3]\n  \u003e\u003e\u003e b                           \u003c\u003c\u003d\u003d As \u0027self.value\u0027, new list, replicated by \u0027b \u003d list(a)\u0027\n  [-1, 2, 3]\n  \u003e\u003e\u003e c\n  [-1, 2, 3, 4]\n  \u003e\u003e\u003e b.append(Foo(5))    \u003c\u003c\u003d\u003d Append a new element to the \u0027b\u0027, as \u0027StoreLocations.append()\u0027 did.\n  \u003e\u003e\u003e b\n  [-1, 2, 3, 5]\n  \u003e\u003e\u003e c\n  [-1, 2, 3, 4]\n  \u003e\u003e\u003e a\n  [-1, 2, 3]                       \u003c\u003c\u003d\u003d The changes on \u0027b\u0027 does not affect original list \u0027a\u0027.\n\n\nActually, if I change here code as your mentioned, the unittest will be failed since the changes in \u0027StoreLocations\u0027 class will not affect \u0027locations\u0027 object content of the external ImageProxy object.","commit_id":"ef21fe1b4fcbdc11b7499f6e7c28fe26753adf02"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"a13bcda9f856e5291641696733d47e5d8871769d","unresolved":false,"context_lines":[{"line_number":527,"context_line":"        value \u003d getattr(getattr(self, target), attr)"},{"line_number":528,"context_line":"        return StoreLocations(self, value)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def set_attr(self, value):"},{"line_number":531,"context_line":"        # NOTE(zhiyan): Check locations are all valid."},{"line_number":532,"context_line":"        if not isinstance(value, (list, StoreLocations)):"},{"line_number":533,"context_line":"            raise exception.BadStoreUri(_(\u0027Invalid locations: %s\u0027) % value)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2F%2FKw%3D","line":530,"updated":"2013-07-07 18:50:46.000000000","message":"I am wondering, does calling image.locations \u003d ... delete all the previous entries in image.locations? or is it somehow enforced that image.locations was previously [] (empty list) ?","commit_id":"ef21fe1b4fcbdc11b7499f6e7c28fe26753adf02"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"469ab049a61c4e407338218b89e12bd0933d3715","unresolved":false,"context_lines":[{"line_number":527,"context_line":"        value \u003d getattr(getattr(self, target), attr)"},{"line_number":528,"context_line":"        return StoreLocations(self, value)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def set_attr(self, value):"},{"line_number":531,"context_line":"        # NOTE(zhiyan): Check locations are all valid."},{"line_number":532,"context_line":"        if not isinstance(value, (list, StoreLocations)):"},{"line_number":533,"context_line":"            raise exception.BadStoreUri(_(\u0027Invalid locations: %s\u0027) % value)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2F%2B6c%3D","line":530,"in_reply_to":"AAAAP3%2F%2F%2FKw%3D","updated":"2013-07-08 03:45:04.000000000","message":"Good catch, I will adding a checking to require image.locations was previously empty list here.","commit_id":"ef21fe1b4fcbdc11b7499f6e7c28fe26753adf02"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"a13bcda9f856e5291641696733d47e5d8871769d","unresolved":false,"context_lines":[{"line_number":538,"context_line":"    def del_attr(self):"},{"line_number":539,"context_line":"        value \u003d getattr(getattr(self, target), attr)"},{"line_number":540,"context_line":"        while len(value):"},{"line_number":541,"context_line":"            delete_image_from_backend(self.context, self.store_api,"},{"line_number":542,"context_line":"                                      self.image.image_id, value[0])"},{"line_number":543,"context_line":"            del value[0]"},{"line_number":544,"context_line":"            setattr(getattr(self, target), attr, value)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2F%2FKs%3D","line":541,"updated":"2013-07-07 18:50:46.000000000","message":"One thought I had, should we put some exception handling around this delete? We might want to make a best effort to delete from as many stores as possible. If any exceptions occur, we could try to delete other locations still, and then raise afterwards with an aggregated exception.\n\nI\u0027m not sure what the best course is here, but wanted to raise the issue.","commit_id":"ef21fe1b4fcbdc11b7499f6e7c28fe26753adf02"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"469ab049a61c4e407338218b89e12bd0933d3715","unresolved":false,"context_lines":[{"line_number":538,"context_line":"    def del_attr(self):"},{"line_number":539,"context_line":"        value \u003d getattr(getattr(self, target), attr)"},{"line_number":540,"context_line":"        while len(value):"},{"line_number":541,"context_line":"            delete_image_from_backend(self.context, self.store_api,"},{"line_number":542,"context_line":"                                      self.image.image_id, value[0])"},{"line_number":543,"context_line":"            del value[0]"},{"line_number":544,"context_line":"            setattr(getattr(self, target), attr, value)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAP3%2F%2F%2B50%3D","line":541,"in_reply_to":"AAAAP3%2F%2F%2FKs%3D","updated":"2013-07-08 03:45:04.000000000","message":"After the thinking, I don\u0027t think aggregated exception is a good idea, and not like \u0027make a best effort to delete from as many stores as possible\u0027. IMO, we\u0027d better tell client what exception here happened, and allow client to make decision how to handling this, other word we\u0027d better not make decision which we consider it\u0027s good instead client/uesr.\n\nAlso, client/user can easy do following to continue the deletion:\n1. resolve issue to resolve exception.\n2. just recall \u0027del()\u0027 again.\n\nDo you think so?","commit_id":"ef21fe1b4fcbdc11b7499f6e7c28fe26753adf02"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"30ddaf01ce609eb73a9cb0b901319830a58b07a0","unresolved":false,"context_lines":[{"line_number":516,"context_line":"        return iter(self.value)"},{"line_number":517,"context_line":""},{"line_number":518,"context_line":""},{"line_number":519,"context_line":"def _locations_proxy(target, attr):"},{"line_number":520,"context_line":"    \"\"\""},{"line_number":521,"context_line":"    Make a location property proxy on the image object."},{"line_number":522,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2F%2BSs%3D","line":519,"updated":"2013-07-08 09:51:25.000000000","message":"I\u0027d rather pass the target\u0027s instance instead of its attribute name, That reduces a number of getattrs in this closure.","commit_id":"64adc444dd4d1dec8dad692b67dd5284762b20ba"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"30ddaf01ce609eb73a9cb0b901319830a58b07a0","unresolved":false,"context_lines":[{"line_number":524,"context_line":"    :param attr: the property proxy we want to hook"},{"line_number":525,"context_line":"    \"\"\""},{"line_number":526,"context_line":"    def get_attr(self):"},{"line_number":527,"context_line":"        value \u003d getattr(getattr(self, target), attr)"},{"line_number":528,"context_line":"        return StoreLocations(self, value)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"    def set_attr(self, value):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2F%2BRA%3D","line":527,"updated":"2013-07-08 09:51:25.000000000","message":"This could be something like: \n\nvalue \u003d getattr(target, attr)","commit_id":"64adc444dd4d1dec8dad692b67dd5284762b20ba"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"30ddaf01ce609eb73a9cb0b901319830a58b07a0","unresolved":false,"context_lines":[{"line_number":558,"context_line":"    locations \u003d _locations_proxy(\u0027image\u0027, \u0027locations\u0027)"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"    def __init__(self, image, context, store_api):"},{"line_number":561,"context_line":"        self.image \u003d image"},{"line_number":562,"context_line":"        self.context \u003d context"},{"line_number":563,"context_line":"        self.store_api \u003d store_api"},{"line_number":564,"context_line":"        proxy_kwargs \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2F%2BSI%3D","line":561,"updated":"2013-07-08 09:51:25.000000000","message":"If we apply the above, we\u0027d have something like:\n\n     self.locations \u003d _locations_proxy(self.image, \u0027locations\u0027)","commit_id":"64adc444dd4d1dec8dad692b67dd5284762b20ba"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"a9499d633231ba2dac56e8d319d31afb0ab1ab02","unresolved":false,"context_lines":[{"line_number":558,"context_line":"    locations \u003d _locations_proxy(\u0027image\u0027, \u0027locations\u0027)"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"    def __init__(self, image, context, store_api):"},{"line_number":561,"context_line":"        self.image \u003d image"},{"line_number":562,"context_line":"        self.context \u003d context"},{"line_number":563,"context_line":"        self.store_api \u003d store_api"},{"line_number":564,"context_line":"        proxy_kwargs \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAP3%2F%2F%2BEY%3D","line":561,"in_reply_to":"AAAAP3%2F%2F%2BSI%3D","updated":"2013-07-08 11:21:34.000000000","message":"Sorry, I don\u0027t think so IMO correctly.","commit_id":"64adc444dd4d1dec8dad692b67dd5284762b20ba"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"c97435f672452c18f36e7b22e6b9e74d135da16b","unresolved":false,"context_lines":[{"line_number":368,"context_line":"    except (exception.UnknownScheme, exception.NotFound):"},{"line_number":369,"context_line":"        is_ok \u003d False"},{"line_number":370,"context_line":"    if not is_ok:"},{"line_number":371,"context_line":"        raise exception.BadStoreUri(_(\u0027Invalid location: %s\u0027) % uri)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"class ImageFactoryProxy(glance.domain.proxy.ImageFactory):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F12s%3D","line":371,"updated":"2013-07-10 16:16:35.000000000","message":"could get_size_from_backend raise the exception due to other reasons apart from BadStoreUri?\nhttps://github.com/openstack/glance/blob/master/glance/store/swift.py#L301 cause this could be due to other reasons as well.","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"e721d19da81d4fb272d8e4626e94b0e01f28d2fa","unresolved":false,"context_lines":[{"line_number":368,"context_line":"    except (exception.UnknownScheme, exception.NotFound):"},{"line_number":369,"context_line":"        is_ok \u003d False"},{"line_number":370,"context_line":"    if not is_ok:"},{"line_number":371,"context_line":"        raise exception.BadStoreUri(_(\u0027Invalid location: %s\u0027) % uri)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"class ImageFactoryProxy(glance.domain.proxy.ImageFactory):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1hw%3D","line":371,"in_reply_to":"AAAAP3%2F%2F12s%3D","updated":"2013-07-10 16:37:52.000000000","message":"I think I have covered this on above #367 line (#366 has a comment).","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5853f83f350d32f46efe076da01384ae9c4fa255","unresolved":false,"context_lines":[{"line_number":368,"context_line":"    except (exception.UnknownScheme, exception.NotFound):"},{"line_number":369,"context_line":"        is_ok \u003d False"},{"line_number":370,"context_line":"    if not is_ok:"},{"line_number":371,"context_line":"        raise exception.BadStoreUri(_(\u0027Invalid location: %s\u0027) % uri)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"class ImageFactoryProxy(glance.domain.proxy.ImageFactory):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1S8%3D","line":371,"in_reply_to":"AAAAP3%2F%2F1eA%3D","updated":"2013-07-10 18:58:48.000000000","message":"Also, it\u0027 isn\u0027t valuable for client when a client give a \u00270\u0027 size backend location to glance (such as via PATCH API).","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"15767f8ad45e9bf477221872ad9946f07662c1ff","unresolved":false,"context_lines":[{"line_number":368,"context_line":"    except (exception.UnknownScheme, exception.NotFound):"},{"line_number":369,"context_line":"        is_ok \u003d False"},{"line_number":370,"context_line":"    if not is_ok:"},{"line_number":371,"context_line":"        raise exception.BadStoreUri(_(\u0027Invalid location: %s\u0027) % uri)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"class ImageFactoryProxy(glance.domain.proxy.ImageFactory):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1cc%3D","line":371,"in_reply_to":"AAAAP3%2F%2F1eA%3D","updated":"2013-07-10 17:00:43.000000000","message":"Yes, \u00270\u0027 means (ok, 99% means) store.get_size() meet an exception, so the url can be considered wrong/invalid IMO.","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"f0e388f3510b2c11f96304f7ef67497ec2016b2c","unresolved":false,"context_lines":[{"line_number":368,"context_line":"    except (exception.UnknownScheme, exception.NotFound):"},{"line_number":369,"context_line":"        is_ok \u003d False"},{"line_number":370,"context_line":"    if not is_ok:"},{"line_number":371,"context_line":"        raise exception.BadStoreUri(_(\u0027Invalid location: %s\u0027) % uri)"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":""},{"line_number":374,"context_line":"class ImageFactoryProxy(glance.domain.proxy.ImageFactory):"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1eA%3D","line":371,"in_reply_to":"AAAAP3%2F%2F1hw%3D","updated":"2013-07-10 16:55:06.000000000","message":"Yes I agree, that is exactly my point that it may return 0 for reasons other than badstore uri, so do you think that is the right exception?","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"c97435f672452c18f36e7b22e6b9e74d135da16b","unresolved":false,"context_lines":[{"line_number":439,"context_line":"        return self.value.index(uri, *args)"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"    def remove(self, uri):"},{"line_number":442,"context_line":"        if self.count(uri):"},{"line_number":443,"context_line":"            delete_image_from_backend(self.image_proxy.context,"},{"line_number":444,"context_line":"                                      self.image_proxy.store_api,"},{"line_number":445,"context_line":"                                      self.image_proxy.image.image_id,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1pY%3D","line":442,"updated":"2013-07-10 16:16:35.000000000","message":"could this just be abstracted away to pop?","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5853f83f350d32f46efe076da01384ae9c4fa255","unresolved":false,"context_lines":[{"line_number":439,"context_line":"        return self.value.index(uri, *args)"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"    def remove(self, uri):"},{"line_number":442,"context_line":"        if self.count(uri):"},{"line_number":443,"context_line":"            delete_image_from_backend(self.image_proxy.context,"},{"line_number":444,"context_line":"                                      self.image_proxy.store_api,"},{"line_number":445,"context_line":"                                      self.image_proxy.image.image_id,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1TY%3D","line":442,"in_reply_to":"AAAAP3%2F%2F1a4%3D","updated":"2013-07-10 18:58:48.000000000","message":"Done","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"c06439f50ea294f63cb2ae9c0f028b6662dfc296","unresolved":false,"context_lines":[{"line_number":439,"context_line":"        return self.value.index(uri, *args)"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"    def remove(self, uri):"},{"line_number":442,"context_line":"        if self.count(uri):"},{"line_number":443,"context_line":"            delete_image_from_backend(self.image_proxy.context,"},{"line_number":444,"context_line":"                                      self.image_proxy.store_api,"},{"line_number":445,"context_line":"                                      self.image_proxy.image.image_id,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1a4%3D","line":442,"in_reply_to":"AAAAP3%2F%2F1hQ%3D","updated":"2013-07-10 17:09:00.000000000","message":"Also this doesnt catch exceptions like pop does while deleting, I just think its more efficient code wise. But thats just my opinion. I will let you decide on that one :)","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"e721d19da81d4fb272d8e4626e94b0e01f28d2fa","unresolved":false,"context_lines":[{"line_number":439,"context_line":"        return self.value.index(uri, *args)"},{"line_number":440,"context_line":""},{"line_number":441,"context_line":"    def remove(self, uri):"},{"line_number":442,"context_line":"        if self.count(uri):"},{"line_number":443,"context_line":"            delete_image_from_backend(self.image_proxy.context,"},{"line_number":444,"context_line":"                                      self.image_proxy.store_api,"},{"line_number":445,"context_line":"                                      self.image_proxy.image.image_id,"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1hQ%3D","line":442,"in_reply_to":"AAAAP3%2F%2F1pY%3D","updated":"2013-07-10 16:37:52.000000000","message":"Is this way more easy?","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"c97435f672452c18f36e7b22e6b9e74d135da16b","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        self.value.remove(uri)"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"    def reverse(self):"},{"line_number":450,"context_line":"        self.value.reverse()"},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"    # Mutable sequence, so not hashable"},{"line_number":453,"context_line":"    __hash__ \u003d None"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1pE%3D","line":450,"updated":"2013-07-10 16:16:35.000000000","message":"just curious whats the use case for reverse?","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"e721d19da81d4fb272d8e4626e94b0e01f28d2fa","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        self.value.remove(uri)"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"    def reverse(self):"},{"line_number":450,"context_line":"        self.value.reverse()"},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"    # Mutable sequence, so not hashable"},{"line_number":453,"context_line":"    __hash__ \u003d None"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1ik%3D","line":450,"in_reply_to":"AAAAP3%2F%2F1pE%3D","updated":"2013-07-10 16:37:52.000000000","message":"I\u0027d like make this proxy behavior more like \u0027MutableSequence\u0027. Also I have write the UT for the method.","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"c97435f672452c18f36e7b22e6b9e74d135da16b","unresolved":false,"context_lines":[{"line_number":577,"context_line":"            if CONF.delayed_delete:"},{"line_number":578,"context_line":"                self.image.status \u003d \u0027pending_delete\u0027"},{"line_number":579,"context_line":"            for location in self.image.locations:"},{"line_number":580,"context_line":"                self.store_api.delete_image_from_backend(self.context,"},{"line_number":581,"context_line":"                                                         self.store_api,"},{"line_number":582,"context_line":"                                                         self.image.image_id,"},{"line_number":583,"context_line":"                                                         location)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1ns%3D","line":580,"updated":"2013-07-10 16:16:35.000000000","message":"should we be deleting the location object instead of directly calling delete image form backend?","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b7485b3adc9805a5a7ab15a8df2afa6b643cfc8d","unresolved":false,"context_lines":[{"line_number":577,"context_line":"            if CONF.delayed_delete:"},{"line_number":578,"context_line":"                self.image.status \u003d \u0027pending_delete\u0027"},{"line_number":579,"context_line":"            for location in self.image.locations:"},{"line_number":580,"context_line":"                self.store_api.delete_image_from_backend(self.context,"},{"line_number":581,"context_line":"                                                         self.store_api,"},{"line_number":582,"context_line":"                                                         self.image.image_id,"},{"line_number":583,"context_line":"                                                         location)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1e4%3D","line":580,"in_reply_to":"AAAAP3%2F%2F1ns%3D","updated":"2013-07-10 16:51:29.000000000","message":"After more thinking, I have agree this input. Seems I\u0027m mis-understand your point here :)","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"e721d19da81d4fb272d8e4626e94b0e01f28d2fa","unresolved":false,"context_lines":[{"line_number":577,"context_line":"            if CONF.delayed_delete:"},{"line_number":578,"context_line":"                self.image.status \u003d \u0027pending_delete\u0027"},{"line_number":579,"context_line":"            for location in self.image.locations:"},{"line_number":580,"context_line":"                self.store_api.delete_image_from_backend(self.context,"},{"line_number":581,"context_line":"                                                         self.store_api,"},{"line_number":582,"context_line":"                                                         self.image.image_id,"},{"line_number":583,"context_line":"                                                         location)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1i8%3D","line":580,"in_reply_to":"AAAAP3%2F%2F1ns%3D","updated":"2013-07-10 16:37:52.000000000","message":"actually before I write this patch, markwash, jbresnahan and I have discussed this, and we\u0027d like glance own image\u0027s location and its content. that means when client remove the location glance will remove the image content from the backend.","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5853f83f350d32f46efe076da01384ae9c4fa255","unresolved":false,"context_lines":[{"line_number":577,"context_line":"            if CONF.delayed_delete:"},{"line_number":578,"context_line":"                self.image.status \u003d \u0027pending_delete\u0027"},{"line_number":579,"context_line":"            for location in self.image.locations:"},{"line_number":580,"context_line":"                self.store_api.delete_image_from_backend(self.context,"},{"line_number":581,"context_line":"                                                         self.store_api,"},{"line_number":582,"context_line":"                                                         self.image.image_id,"},{"line_number":583,"context_line":"                                                         location)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1TU%3D","line":580,"in_reply_to":"AAAAP3%2F%2F1ns%3D","updated":"2013-07-10 18:58:48.000000000","message":"iccha, after I change here code as following [1], I have meet a lot of UT failures, the root cause is that there are a lot of UT need check location by the URL after its image deleted. For example: glance/tests/unit/test_store_image.py #102, #122, #138 and etc. Lines. If I change code to [1], the image.delete() will clear all the location from the \u0027locations\u0027 property list of the image, and cause thoe UT failure. So, for those checkings in the UT can work well, I will keep current code here.\n\n[1]\n    def delete(self):\n        self.image.delete()\n        if self.image.locations:\n            if CONF.delayed_delete:\n                self.image.status \u003d \u0027pending_delete\u0027\n            del self.locations[:]","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"}],"glance/tests/unit/test_store_image.py":[{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        self.assertEquals(image_stub1.locations, [UUID2, UUID3])"},{"line_number":163,"context_line":"        self.assertEquals(image1.locations, [UUID2, UUID3])"},{"line_number":164,"context_line":"        self.assertRaises(exception.BadStoreUri,"},{"line_number":165,"context_line":"                          image1.locations.append, \u0027unknow://location\u0027)"},{"line_number":166,"context_line":"        # 2. pop a location"},{"line_number":167,"context_line":"        image1.locations.pop()"},{"line_number":168,"context_line":"        self.assertEquals(image_stub1.locations, [UUID2])"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2Fa%2FM%3D","line":165,"updated":"2013-07-02 10:56:08.000000000","message":"Typo on \"unknown\" (There are other instances throughout the patchset, I won\u0027t mark each!)","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        self.assertEquals(image_stub1.locations, [UUID2, UUID3])"},{"line_number":163,"context_line":"        self.assertEquals(image1.locations, [UUID2, UUID3])"},{"line_number":164,"context_line":"        self.assertRaises(exception.BadStoreUri,"},{"line_number":165,"context_line":"                          image1.locations.append, \u0027unknow://location\u0027)"},{"line_number":166,"context_line":"        # 2. pop a location"},{"line_number":167,"context_line":"        image1.locations.pop()"},{"line_number":168,"context_line":"        self.assertEquals(image_stub1.locations, [UUID2])"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FXvg%3D","line":165,"in_reply_to":"AAAAPn%2F%2Fa%2FM%3D","updated":"2013-07-03 06:34:05.000000000","message":"All done.","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6493,"name":"John Bresnahan","email":"john@bresnahan.me","username":"jbresnah"},"change_message_id":"9f026737ead708c78dd366ac7c854eb7e7bdd990","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self.assertEqual(image.status, \u0027active\u0027)"},{"line_number":150,"context_line":"        return (image, image_stub)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_image_change_locations(self):"},{"line_number":153,"context_line":"        UUID3 \u003d \u0027a8a61ec4-d7a3-11e2-8c28-000c29c27581\u0027"},{"line_number":154,"context_line":"        self.assertEqual(len(self.store_api.data.keys()), 1)"},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2F6wE%3D","line":152,"updated":"2013-07-09 08:23:28.000000000","message":"I would like to see this broken into several distinct tests instead of one large one.  I understand that some go hand in hand because you have to add in order to extend/remove/pop/delete.  But many of these operations do not depend upon each other.","commit_id":"a63a25fd9fdc971625637c3b3e50adc2e3905610"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c81fcfe582bf9e708a1e453388081f32949470b0","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        self.assertEqual(image.status, \u0027active\u0027)"},{"line_number":150,"context_line":"        return (image, image_stub)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_image_change_locations(self):"},{"line_number":153,"context_line":"        UUID3 \u003d \u0027a8a61ec4-d7a3-11e2-8c28-000c29c27581\u0027"},{"line_number":154,"context_line":"        self.assertEqual(len(self.store_api.data.keys()), 1)"},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2F6m4%3D","line":152,"in_reply_to":"AAAAP3%2F%2F6wE%3D","updated":"2013-07-09 09:07:26.000000000","message":"Done","commit_id":"a63a25fd9fdc971625637c3b3e50adc2e3905610"},{"author":{"_account_id":6493,"name":"John Bresnahan","email":"john@bresnahan.me","username":"jbresnah"},"change_message_id":"d2c87641a6c3fcc00d5abe504b026a362b104652","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        self.assertEquals(image_stub1.locations, [UUID2, UUID3])"},{"line_number":163,"context_line":"        self.assertEquals(image1.locations, [UUID2, UUID3])"},{"line_number":164,"context_line":"        self.assertRaises(exception.BadStoreUri,"},{"line_number":165,"context_line":"                          image1.locations.append, \u0027unknown://location\u0027)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        image1.delete()"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F4Tg%3D","line":165,"updated":"2013-07-09 21:30:09.000000000","message":"The above really seems like it could be its own test.","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5853f83f350d32f46efe076da01384ae9c4fa255","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        self.assertEquals(image_stub1.locations, [UUID2, UUID3])"},{"line_number":163,"context_line":"        self.assertEquals(image1.locations, [UUID2, UUID3])"},{"line_number":164,"context_line":"        self.assertRaises(exception.BadStoreUri,"},{"line_number":165,"context_line":"                          image1.locations.append, \u0027unknown://location\u0027)"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"        image1.delete()"},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2F1Kc%3D","line":165,"in_reply_to":"AAAAP3%2F%2F4Tg%3D","updated":"2013-07-10 18:58:48.000000000","message":"Done","commit_id":"ae4f925e06e28723631ae5a7540d83787d39fb6f"}],"glance/tests/unit/utils.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1cffd05e7b65e1c1df377f8dff70ffb11186bb0c","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def get_from_backend(self, context, location):"},{"line_number":108,"context_line":"        try:"},{"line_number":109,"context_line":"            scheme \u003d location[0:location.find(\u0027/\u0027) - 1]"},{"line_number":110,"context_line":"            if scheme \u003d\u003d \u0027unknow\u0027:"},{"line_number":111,"context_line":"                raise exception.UnknownScheme(scheme\u003dscheme)"},{"line_number":112,"context_line":"            return self.data[location]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2FiEc%3D","line":109,"updated":"2013-06-28 12:27:04.000000000","message":"The 0 is not needed here.","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d139422373c65acd5dd0e0d3d7ecf44c6356569","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def get_from_backend(self, context, location):"},{"line_number":108,"context_line":"        try:"},{"line_number":109,"context_line":"            scheme \u003d location[0:location.find(\u0027/\u0027) - 1]"},{"line_number":110,"context_line":"            if scheme \u003d\u003d \u0027unknow\u0027:"},{"line_number":111,"context_line":"                raise exception.UnknownScheme(scheme\u003dscheme)"},{"line_number":112,"context_line":"            return self.data[location]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPn%2F%2Ff14%3D","line":109,"in_reply_to":"AAAAPn%2F%2FiEc%3D","updated":"2013-06-29 08:26:49.000000000","message":"Done","commit_id":"1f780666e96b02383f47e04cd8a9dd1b64f3c5e1"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"448329bb6b900ff319fede2f1cae7d1bdedfd3b0","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            if CONF.delayed_delete:"},{"line_number":131,"context_line":"                self.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":132,"context_line":"            else:"},{"line_number":133,"context_line":"                self.safe_delete_from_backend(uri, context, image_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_size_from_backend(self, context, location):"},{"line_number":136,"context_line":"        return self.get_from_backend(context, location)[1]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2Fa%2F4%3D","line":133,"updated":"2013-07-02 10:56:08.000000000","message":"Where is this new function used?","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"bf3c8a3f487cc706469300efbdb7689a8be73504","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            if CONF.delayed_delete:"},{"line_number":131,"context_line":"                self.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":132,"context_line":"            else:"},{"line_number":133,"context_line":"                self.safe_delete_from_backend(uri, context, image_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_size_from_backend(self, context, location):"},{"line_number":136,"context_line":"        return self.get_from_backend(context, location)[1]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FTH8%3D","line":133,"in_reply_to":"AAAAPn%2F%2FTTk%3D","updated":"2013-07-04 15:48:14.000000000","message":"ur welcome.","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"3ae5c6e04e103385c07fac7e20b36c60f8180255","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            if CONF.delayed_delete:"},{"line_number":131,"context_line":"                self.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":132,"context_line":"            else:"},{"line_number":133,"context_line":"                self.safe_delete_from_backend(uri, context, image_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_size_from_backend(self, context, location):"},{"line_number":136,"context_line":"        return self.get_from_backend(context, location)[1]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FTTk%3D","line":133,"in_reply_to":"AAAAPn%2F%2FUdE%3D","updated":"2013-07-04 14:32:47.000000000","message":"Got it, thanks for explaining.","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"e7c21080ba78b016fcf5ca9920c50ae907a4a09f","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            if CONF.delayed_delete:"},{"line_number":131,"context_line":"                self.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":132,"context_line":"            else:"},{"line_number":133,"context_line":"                self.safe_delete_from_backend(uri, context, image_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_size_from_backend(self, context, location):"},{"line_number":136,"context_line":"        return self.get_from_backend(context, location)[1]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FUdE%3D","line":133,"in_reply_to":"AAAAPn%2F%2FW%2Fc%3D","updated":"2013-07-04 03:16:11.000000000","message":"This method (FakeStoreAPI.delete_image_from_backend) will be called in store.ImageProxy.delete() as a hook/callback function when the image removing triggered by those unit test cases.\nYou may need check follow code:\nhttps://review.openstack.org/#/c/34501/4/glance/tests/unit/test_store_image.py Line#83\nhttps://review.openstack.org/#/c/34501/4/glance/tests/unit/test_store_image.py Line#144\nhttps://review.openstack.org/#/c/34501/4/glance/store/__init__.py Line#579\nhttps://review.openstack.org/#/c/34501/4/glance/tests/unit/test_store_image.py Line#170\nhttps://review.openstack.org/#/c/34501/4/glance/store/__init__.py Line#595","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":1390,"name":"Paul Bourke","email":"pauldbourke@proton.me","username":"pauldbourke"},"change_message_id":"8e3c7c53f5940d7619cfd59f07a5a1c4f436784e","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            if CONF.delayed_delete:"},{"line_number":131,"context_line":"                self.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":132,"context_line":"            else:"},{"line_number":133,"context_line":"                self.safe_delete_from_backend(uri, context, image_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_size_from_backend(self, context, location):"},{"line_number":136,"context_line":"        return self.get_from_backend(context, location)[1]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FW%2Fc%3D","line":133,"in_reply_to":"AAAAPn%2F%2FX0w%3D","updated":"2013-07-03 11:13:56.000000000","message":"Sorry maybe I\u0027m missing something here...  \n\n\u0027grep -r delete_image_from_backend glance/tests\u0027 doesn\u0027t give me any instances of this function being used, at least as of git 9daf3870?\n\nHow is it relevant to this patchset in particular?","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"127f5ab808a96bd52153593de8780da9fcd6f331","unresolved":false,"context_lines":[{"line_number":130,"context_line":"            if CONF.delayed_delete:"},{"line_number":131,"context_line":"                self.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":132,"context_line":"            else:"},{"line_number":133,"context_line":"                self.safe_delete_from_backend(uri, context, image_id)"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def get_size_from_backend(self, context, location):"},{"line_number":136,"context_line":"        return self.get_from_backend(context, location)[1]"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPn%2F%2FX0w%3D","line":133,"in_reply_to":"AAAAPn%2F%2Fa%2F4%3D","updated":"2013-07-03 06:34:05.000000000","message":"There are a lot of test case need this function. They are:\nglance.tests.unit.v2.test_images_resource.TestImagesController.test_delayed_delete\n(glance/tests/unit/v2/test_images_resource.py:test_delayed_delete)\nglance.tests.unit.v2.test_images_resource.TestImagesController.test_delete_already_deleted_image_admin\n(glance/tests/unit/v2/test_images_resource.py:test_delete_already_deleted_image_admin)\nglance.tests.unit.v2.test_images_resource.TestImagesController.test_delete_not_in_store\n(glance/tests/unit/v2/test_images_resource.py:test_delete_not_in_store)\nglance.tests.unit.v2.test_images_resource.TestImagesController.test_index_admin_deleted_images_hidden\n(glance/tests/unit/v2/test_images_resource.py:test_index_admin_deleted_images_hidden)\nglance.tests.unit.v2.test_images_resource.TestImagesController.test_show_deleted_image_admin\n(glance/tests/unit/v2/test_images_resource.py:test_show_deleted_image_admin)\nglance.tests.unit.v2.test_images_resource.TestImagesController.test_update_deleted_image_admin\n(glance/tests/unit/v2/test_images_resource.py:test_update_deleted_image_admin)\nglance.tests.unit.test_store_image.TestStoreImage.test_image_change_locations\n(glance/tests/unit/test_store_image.py:test_image_change_locations)\nglance.tests.unit.test_store_image.TestStoreImage.test_image_delayed_delete\n(glance/tests/unit/test_store_image.py:test_image_delayed_delete)\nglance.tests.unit.test_store_image.TestStoreImage.test_image_delete\n(glance/tests/unit/test_store_image.py:test_image_delete)\nglance.tests.unit.test_store_image.TestStoreImage.test_image_set_data\n(glance/tests/unit/test_store_image.py:test_image_set_data)\nglance.tests.unit.test_store_image.TestStoreImage.test_image_set_data_unknown_size\n(glance/tests/unit/test_store_image.py:test_image_set_data_unknown_size)\nglance.tests.unit.v2.test_images_resource.TestImagesController.test_delete\n(glance/tests/unit/v2/test_images_resource.py:test_delete)","commit_id":"fbec581ddab1c839b083a39cbd140cab890e0710"},{"author":{"_account_id":6493,"name":"John Bresnahan","email":"john@bresnahan.me","username":"jbresnah"},"change_message_id":"9f026737ead708c78dd366ac7c854eb7e7bdd990","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    def schedule_delayed_delete_from_backend(self, uri, id, **kwargs):"},{"line_number":126,"context_line":"        pass"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def delete_image_from_backend(self, context, store_api, image_id, uri):"},{"line_number":129,"context_line":"        if CONF.delayed_delete:"},{"line_number":130,"context_line":"            self.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":131,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2F6vc%3D","line":128,"updated":"2013-07-09 08:23:28.000000000","message":"Is this ever called?","commit_id":"a63a25fd9fdc971625637c3b3e50adc2e3905610"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"c81fcfe582bf9e708a1e453388081f32949470b0","unresolved":false,"context_lines":[{"line_number":125,"context_line":"    def schedule_delayed_delete_from_backend(self, uri, id, **kwargs):"},{"line_number":126,"context_line":"        pass"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def delete_image_from_backend(self, context, store_api, image_id, uri):"},{"line_number":129,"context_line":"        if CONF.delayed_delete:"},{"line_number":130,"context_line":"            self.schedule_delayed_delete_from_backend(uri, image_id)"},{"line_number":131,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAP3%2F%2F6m8%3D","line":128,"in_reply_to":"AAAAP3%2F%2F6vc%3D","updated":"2013-07-09 09:07:26.000000000","message":"Please refer comments in https://review.openstack.org/#/c/34501/4/glance/tests/unit/utils.py","commit_id":"a63a25fd9fdc971625637c3b3e50adc2e3905610"}]}
