)]}'
{"glance/api/v2/images.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5647757bf9440905f291b500778e551775f408f7","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            del image.locations[:]"},{"line_number":223,"context_line":"            if image.status \u003d\u003d \u0027active\u0027:"},{"line_number":224,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":225,"context_line":"                image.size \u003d None"},{"line_number":226,"context_line":"        else:   # NOTE(zhiyan): len(image.locations) \u003d\u003d 0"},{"line_number":227,"context_line":"            try:"},{"line_number":228,"context_line":"                image.locations \u003d value"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAT3%2F%2FrFA%3D","line":225,"updated":"2014-01-03 17:59:18.000000000","message":"@flwang, this is a good point to get fix firstly. Secondly I think this fix is more like a basic general for image entry but a particular handling for v2 controller, I mean when an image turn to \"queued\" status then its size should always be reset to None but any valid number. So can we think about do this logic in domain level? like at https://github.com/openstack/glance/blob/master/glance/domain/__init__.py#L128 .\n\nI know that may break other existing code logic in other place/level, and actually I have not check the code yet for that way I proposed above, so can you verify that in your develop env? if you think it is a good way to go, or your idea?","commit_id":"019a3ef0626140e6944796ec3bbc1b15685c4540"}],"glance/quota/__init__.py":[{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"8005ca431e14fb07f9f6bf7e5480fef421b77276","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            try:"},{"line_number":56,"context_line":"                size_from_backend \u003d glance.store.get_size_from_backend("},{"line_number":57,"context_line":"                    context, location[\u0027url\u0027])"},{"line_number":58,"context_line":"            except Exception:"},{"line_number":59,"context_line":"                pass"},{"line_number":60,"context_line":"            if size_from_backend:"},{"line_number":61,"context_line":"                required_size \u003d size_from_backend * len(locations)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2Fvy8%3D","line":58,"updated":"2014-01-08 22:42:07.000000000","message":"Hey Fei,\n\nCould you explain why we pass this exception?","commit_id":"785d803b6011ff4eebcbe078ab84cf59c4e4ba65"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"08e0ffc1d98cbcafbbadafa430a653695894246a","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            try:"},{"line_number":56,"context_line":"                size_from_backend \u003d glance.store.get_size_from_backend("},{"line_number":57,"context_line":"                    context, location[\u0027url\u0027])"},{"line_number":58,"context_line":"            except Exception:"},{"line_number":59,"context_line":"                pass"},{"line_number":60,"context_line":"            if size_from_backend:"},{"line_number":61,"context_line":"                required_size \u003d size_from_backend * len(locations)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2Ftqc%3D","line":58,"in_reply_to":"AAAAUH%2F%2FueQ%3D","updated":"2014-01-09 10:02:07.000000000","message":"@zhiyan, thanks for helping explanation. Overall it\u0027s correct. And you\u0027re suggestion makes sense for me, will improve it in next PS.\n\n@iccha, actually, this patch is related to https://review.openstack.org/#/c/63707/ in that patch, we\u0027re trying to set image size if the image is transferring from \u0027queued\u0027 to \u0027active\u0027 directly when user add/update locations for the image. The try/except can make sure we can iterate all the locations to get an available image. I improve it at here since it\u0027s breaking some unit test cases since we\u0027re introducing some new behaviour by this change. Does it make sense for you?","commit_id":"785d803b6011ff4eebcbe078ab84cf59c4e4ba65"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"fd3848452dc0e9592c8867572ff6875e185df447","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            try:"},{"line_number":56,"context_line":"                size_from_backend \u003d glance.store.get_size_from_backend("},{"line_number":57,"context_line":"                    context, location[\u0027url\u0027])"},{"line_number":58,"context_line":"            except Exception:"},{"line_number":59,"context_line":"                pass"},{"line_number":60,"context_line":"            if size_from_backend:"},{"line_number":61,"context_line":"                required_size \u003d size_from_backend * len(locations)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FueQ%3D","line":58,"in_reply_to":"AAAAUH%2F%2Fvy8%3D","updated":"2014-01-09 06:04:34.000000000","message":"Good point @iccha.\n\nIMO this try-catch is needed since here is short of checking prevent [1][2] for invalid image location uri, get_size_from_backen() may raise exception out. But @flwang I think we\u0027d better catch those exception be explicit, catch Exception type is sounds a little bad to me since it could swallow potential Glance defect. So IMO can we only cache “exception.UnknownScheme” and \"exception.NotFound\"? just like [3].\n\n[1] https://github.com/openstack/glance/blob/master/glance/store/__init__.py#L424\n\n[2] https://github.com/openstack/glance/blob/master/glance/gateway.py#L72\n\n[3] https://github.com/openstack/glance/blob/master/glance/store/__init__.py#L418","commit_id":"785d803b6011ff4eebcbe078ab84cf59c4e4ba65"}]}
