)]}'
{"glance/api/v2/images.py":[{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"1fffae3160dce5a4409d0f06f05d7db65c48d311","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            # NOTE(flwang): When only one location passed in and the URL of the"},{"line_number":271,"context_line":"            # location is existing, that means user would like to update the"},{"line_number":272,"context_line":"            # metadata."},{"line_number":273,"context_line":"            if len(value) \u003d\u003d 1:"},{"line_number":274,"context_line":"                for loc in image.locations:"},{"line_number":275,"context_line":"                    if value[0][\u0027url\u0027] \u003d\u003d loc[\u0027url\u0027]:"},{"line_number":276,"context_line":"                        loc[\u0027metadata\u0027] \u003d value[0][\u0027metadata\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_5c1fbeb6","line":273,"updated":"2016-02-17 13:18:27.000000000","message":"It looks like we don\u0027t send only one location here:\nhttps://github.com/openstack/python-glanceclient/blob/master/glanceclient/v2/images.py#L364.\nclient fetches all locations, update location metadata and send that again.\nAll that we can do here is not delete locations but replace metadata for existing locations, add new locations and remove locations that doesn\u0027t exist in request.","commit_id":"ddbcb5c831fd8337ed3285af745c363bf4f10045"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"edc23cc2bf9d32b6221c5ff1cce42dafb1ccc22c","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            # NOTE(flwang): When only one location passed in and the URL of the"},{"line_number":271,"context_line":"            # location is existing, that means user would like to update the"},{"line_number":272,"context_line":"            # metadata."},{"line_number":273,"context_line":"            if len(value) \u003d\u003d 1:"},{"line_number":274,"context_line":"                for loc in image.locations:"},{"line_number":275,"context_line":"                    if value[0][\u0027url\u0027] \u003d\u003d loc[\u0027url\u0027]:"},{"line_number":276,"context_line":"                        loc[\u0027metadata\u0027] \u003d value[0][\u0027metadata\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"bae84128_7e0db13d","line":273,"in_reply_to":"dae33548_2f6255d8","updated":"2016-02-20 19:49:40.000000000","message":"Yes, I see. I will upload a new patch set to fix it.","commit_id":"ddbcb5c831fd8337ed3285af745c363bf4f10045"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"d71f98955b01208d113af8ac592b0a1c59611179","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            # NOTE(flwang): When only one location passed in and the URL of the"},{"line_number":271,"context_line":"            # location is existing, that means user would like to update the"},{"line_number":272,"context_line":"            # metadata."},{"line_number":273,"context_line":"            if len(value) \u003d\u003d 1:"},{"line_number":274,"context_line":"                for loc in image.locations:"},{"line_number":275,"context_line":"                    if value[0][\u0027url\u0027] \u003d\u003d loc[\u0027url\u0027]:"},{"line_number":276,"context_line":"                        loc[\u0027metadata\u0027] \u003d value[0][\u0027metadata\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_2f6255d8","line":273,"in_reply_to":"dae33548_5c1fbeb6","updated":"2016-02-18 01:18:27.000000000","message":"I saw your client patch. It send the image\u0027s new locations to server side. But if the image has more than one locations, the len(value) here will never equal to 1. So which patch is right?","commit_id":"ddbcb5c831fd8337ed3285af745c363bf4f10045"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"d71f98955b01208d113af8ac592b0a1c59611179","unresolved":false,"context_lines":[{"line_number":282,"context_line":"                            \" locations.\")"},{"line_number":283,"context_line":"                    raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":284,"context_line":"            else:"},{"line_number":285,"context_line":"                msg \u003d _(\"Cannot replace locations from a non-empty \""},{"line_number":286,"context_line":"                        \"list to a non-empty list.\")"},{"line_number":287,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        if len(value) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_cc75b7cb","line":286,"range":{"start_line":285,"start_character":15,"end_line":286,"end_character":52},"updated":"2016-02-18 01:18:27.000000000","message":"error message should be changed as well.","commit_id":"ddbcb5c831fd8337ed3285af745c363bf4f10045"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"d71f98955b01208d113af8ac592b0a1c59611179","unresolved":false,"context_lines":[{"line_number":286,"context_line":"                        \"list to a non-empty list.\")"},{"line_number":287,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        if len(value) \u003d\u003d 0:"},{"line_number":290,"context_line":"            # NOTE(zhiyan): this actually deletes the location"},{"line_number":291,"context_line":"            # from the backend store."},{"line_number":292,"context_line":"            del image.locations[:]"},{"line_number":293,"context_line":"            if image.status \u003d\u003d \u0027active\u0027:"},{"line_number":294,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":295,"context_line":"        else:   # NOTE(zhiyan): len(image.locations) \u003d\u003d 0"},{"line_number":296,"context_line":"            try:"},{"line_number":297,"context_line":"                image.locations \u003d value"}],"source_content_type":"text/x-python","patch_set":3,"id":"dae33548_ec299be7","line":294,"range":{"start_line":289,"start_character":8,"end_line":294,"end_character":39},"updated":"2016-02-18 01:18:27.000000000","message":"we can\u0027t set an active image to queued now. It means that these codes are useless.","commit_id":"ddbcb5c831fd8337ed3285af745c363bf4f10045"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"66acbf92b2bee2ba9b7e6673a0f68433fdbe2568","unresolved":false,"context_lines":[{"line_number":270,"context_line":"            msg \u003d _(\"Cannot replace locations from a non-empty \""},{"line_number":271,"context_line":"                    \"list to a non-empty list.\")"},{"line_number":272,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":273,"context_line":"        if len(value) \u003d\u003d 0:"},{"line_number":274,"context_line":"            # NOTE(zhiyan): this actually deletes the location"},{"line_number":275,"context_line":"            # from the backend store."},{"line_number":276,"context_line":"            del image.locations[:]"},{"line_number":277,"context_line":"            if image.status \u003d\u003d \u0027active\u0027:"},{"line_number":278,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":279,"context_line":"        else:   # NOTE(zhiyan): len(image.locations) \u003d\u003d 0"},{"line_number":280,"context_line":"            try:"},{"line_number":281,"context_line":"                image.locations \u003d value"},{"line_number":282,"context_line":"                if image.status \u003d\u003d \u0027queued\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_c47415ff","side":"PARENT","line":279,"range":{"start_line":273,"start_character":2,"end_line":279,"end_character":57},"updated":"2016-02-26 04:01:11.000000000","message":"Thanks for clearing this up. It has been on my todo list when I get back to work.","commit_id":"67a07d893a92bf54064014560cbdcec7b9411105"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"66acbf92b2bee2ba9b7e6673a0f68433fdbe2568","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        try:"},{"line_number":270,"context_line":"            # NOTE(flwang): Location\u0027s setattr method will check if the update"},{"line_number":271,"context_line":"            # is acceptable."},{"line_number":272,"context_line":"            image.locations \u003d value"},{"line_number":273,"context_line":"            if image.status \u003d\u003d \u0027queued\u0027:"},{"line_number":274,"context_line":"                image.status \u003d \u0027active\u0027"},{"line_number":275,"context_line":"        except (exception.BadStoreUri, exception.DuplicateLocation) as e:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_5f99ec6d","line":272,"updated":"2016-02-26 04:01:11.000000000","message":"I\u0027m not sure about the behavior here, so question. If the len(value) \u003c len(image.locations) do we leave orphan data to the backend?","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"8030be30eaa7c14902f45f8dfeea828003c568aa","unresolved":false,"context_lines":[{"line_number":269,"context_line":"        try:"},{"line_number":270,"context_line":"            # NOTE(flwang): Location\u0027s setattr method will check if the update"},{"line_number":271,"context_line":"            # is acceptable."},{"line_number":272,"context_line":"            image.locations \u003d value"},{"line_number":273,"context_line":"            if image.status \u003d\u003d \u0027queued\u0027:"},{"line_number":274,"context_line":"                image.status \u003d \u0027active\u0027"},{"line_number":275,"context_line":"        except (exception.BadStoreUri, exception.DuplicateLocation) as e:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_16d9fcf3","line":272,"in_reply_to":"9aed3d3a_5f99ec6d","updated":"2016-02-26 12:39:20.000000000","message":"No, like the comment said, _locations_proxy\u0027s setattr will do the check. I will update the comment. Thanks.","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"}],"glance/location.py":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"66acbf92b2bee2ba9b7e6673a0f68433fdbe2568","unresolved":false,"context_lines":[{"line_number":331,"context_line":"            raise exception.BadStoreUri(message\u003dreason)"},{"line_number":332,"context_line":"        ori_value \u003d getattr(getattr(self, target), attr)"},{"line_number":333,"context_line":"        if ori_value !\u003d value:"},{"line_number":334,"context_line":"            # NOTE(zhiyan): Enforced locations list was previously empty list."},{"line_number":335,"context_line":"            # NOTE(flwang): If all the URL of passed-in locations are same as"},{"line_number":336,"context_line":"            # current image locations, that means user would like to only"},{"line_number":337,"context_line":"            # update the metadata, not the URL."}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_ff51e00f","line":334,"updated":"2016-02-26 04:01:11.000000000","message":"This note does not apply anymore with the logic below.","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"8030be30eaa7c14902f45f8dfeea828003c568aa","unresolved":false,"context_lines":[{"line_number":331,"context_line":"            raise exception.BadStoreUri(message\u003dreason)"},{"line_number":332,"context_line":"        ori_value \u003d getattr(getattr(self, target), attr)"},{"line_number":333,"context_line":"        if ori_value !\u003d value:"},{"line_number":334,"context_line":"            # NOTE(zhiyan): Enforced locations list was previously empty list."},{"line_number":335,"context_line":"            # NOTE(flwang): If all the URL of passed-in locations are same as"},{"line_number":336,"context_line":"            # current image locations, that means user would like to only"},{"line_number":337,"context_line":"            # update the metadata, not the URL."}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_962ce74b","line":334,"in_reply_to":"9aed3d3a_ff51e00f","updated":"2016-02-26 12:39:20.000000000","message":"Done","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"7f663af32e6adf1b6679fbf355443e2939b25258","unresolved":false,"context_lines":[{"line_number":338,"context_line":"            ordered_value \u003d sorted([loc[\u0027url\u0027] for loc in value])"},{"line_number":339,"context_line":"            ordered_ori \u003d sorted([loc[\u0027url\u0027] for loc in ori_value])"},{"line_number":340,"context_line":"            if len(ori_value) \u003e 0 and ordered_value !\u003d ordered_ori:"},{"line_number":341,"context_line":"                raise exception.Invalid(_(\u0027Original locations is not empty: \u0027"},{"line_number":342,"context_line":"                                          \u0027%s\u0027) % ori_value)"},{"line_number":343,"context_line":"            # NOTE(zhiyan): Check locations are all valid"},{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_11a0e88f","line":342,"range":{"start_line":341,"start_character":0,"end_line":342,"end_character":60},"updated":"2016-02-25 12:11:54.000000000","message":"we should not return original locations information to users for security. And the error message should be more clear.","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"088c51935ab8eb6e20b4471d76e48080387b6dce","unresolved":false,"context_lines":[{"line_number":338,"context_line":"            ordered_value \u003d sorted([loc[\u0027url\u0027] for loc in value])"},{"line_number":339,"context_line":"            ordered_ori \u003d sorted([loc[\u0027url\u0027] for loc in ori_value])"},{"line_number":340,"context_line":"            if len(ori_value) \u003e 0 and ordered_value !\u003d ordered_ori:"},{"line_number":341,"context_line":"                raise exception.Invalid(_(\u0027Original locations is not empty: \u0027"},{"line_number":342,"context_line":"                                          \u0027%s\u0027) % ori_value)"},{"line_number":343,"context_line":"            # NOTE(zhiyan): Check locations are all valid"},{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_ef964d93","line":342,"range":{"start_line":341,"start_character":0,"end_line":342,"end_character":60},"in_reply_to":"9aed3d3a_843ccd30","updated":"2016-02-26 06:31:35.000000000","message":"If  show_multiple_locations \u003d False, then the user sends a \u0027location-update\u0027 request to an active image with a new location, Glance will raise the error here and the user will know the original location information. \n\nrequest like:\n\nPATCH http://hostip:9292/v2/images/{image-id}\n[\n   {\n      \"op\":\"replace\",\n\t  \"path\":\"/locations\",\n      \"value\":[{\n        \"url\": \"fake-url\", \n        \"metadata\": {}\n      }]\n   }\n]\n\nI didn\u0027t see any check about show_multiple_locations. Do I miss something?","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"8030be30eaa7c14902f45f8dfeea828003c568aa","unresolved":false,"context_lines":[{"line_number":338,"context_line":"            ordered_value \u003d sorted([loc[\u0027url\u0027] for loc in value])"},{"line_number":339,"context_line":"            ordered_ori \u003d sorted([loc[\u0027url\u0027] for loc in ori_value])"},{"line_number":340,"context_line":"            if len(ori_value) \u003e 0 and ordered_value !\u003d ordered_ori:"},{"line_number":341,"context_line":"                raise exception.Invalid(_(\u0027Original locations is not empty: \u0027"},{"line_number":342,"context_line":"                                          \u0027%s\u0027) % ori_value)"},{"line_number":343,"context_line":"            # NOTE(zhiyan): Check locations are all valid"},{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_023896d2","line":342,"range":{"start_line":341,"start_character":0,"end_line":342,"end_character":60},"in_reply_to":"9aed3d3a_ef964d93","updated":"2016-02-26 12:39:20.000000000","message":"@Erno, wangxiyuan is correct. I have tested.","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":15054,"name":"wangxiyuan","email":"wangxiyuan1007@gmail.com","username":"wangxiyuan"},"change_message_id":"14b4d584acdd1c57c556174613839216e2b7de3c","unresolved":false,"context_lines":[{"line_number":338,"context_line":"            ordered_value \u003d sorted([loc[\u0027url\u0027] for loc in value])"},{"line_number":339,"context_line":"            ordered_ori \u003d sorted([loc[\u0027url\u0027] for loc in ori_value])"},{"line_number":340,"context_line":"            if len(ori_value) \u003e 0 and ordered_value !\u003d ordered_ori:"},{"line_number":341,"context_line":"                raise exception.Invalid(_(\u0027Original locations is not empty: \u0027"},{"line_number":342,"context_line":"                                          \u0027%s\u0027) % ori_value)"},{"line_number":343,"context_line":"            # NOTE(zhiyan): Check locations are all valid"},{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_b462ca14","line":342,"range":{"start_line":341,"start_character":0,"end_line":342,"end_character":60},"in_reply_to":"bae84128_11a0e88f","updated":"2016-02-25 12:14:47.000000000","message":"Such as:\nCan\u0027t change the location\u0027s url for the original non-empty locations.\n\nJust a sample.:)","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"66acbf92b2bee2ba9b7e6673a0f68433fdbe2568","unresolved":false,"context_lines":[{"line_number":338,"context_line":"            ordered_value \u003d sorted([loc[\u0027url\u0027] for loc in value])"},{"line_number":339,"context_line":"            ordered_ori \u003d sorted([loc[\u0027url\u0027] for loc in ori_value])"},{"line_number":340,"context_line":"            if len(ori_value) \u003e 0 and ordered_value !\u003d ordered_ori:"},{"line_number":341,"context_line":"                raise exception.Invalid(_(\u0027Original locations is not empty: \u0027"},{"line_number":342,"context_line":"                                          \u0027%s\u0027) % ori_value)"},{"line_number":343,"context_line":"            # NOTE(zhiyan): Check locations are all valid"},{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_843ccd30","line":342,"range":{"start_line":341,"start_character":0,"end_line":342,"end_character":60},"in_reply_to":"bae84128_11a0e88f","updated":"2016-02-26 04:01:11.000000000","message":"This is not correct. IIRC these location operations are only allowed if show_multiple_locations is set to True so user has already visibility what\u0027s in there. Please do not remove the data identifying what\u0027s wrong based on false assumption of security breach.","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"df9dcde8ba4fa005d8d5ecb9fd5863fa260c0093","unresolved":false,"context_lines":[{"line_number":338,"context_line":"            ordered_value \u003d sorted([loc[\u0027url\u0027] for loc in value])"},{"line_number":339,"context_line":"            ordered_ori \u003d sorted([loc[\u0027url\u0027] for loc in ori_value])"},{"line_number":340,"context_line":"            if len(ori_value) \u003e 0 and ordered_value !\u003d ordered_ori:"},{"line_number":341,"context_line":"                raise exception.Invalid(_(\u0027Original locations is not empty: \u0027"},{"line_number":342,"context_line":"                                          \u0027%s\u0027) % ori_value)"},{"line_number":343,"context_line":"            # NOTE(zhiyan): Check locations are all valid"},{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_c61a6217","line":342,"range":{"start_line":341,"start_character":0,"end_line":342,"end_character":60},"in_reply_to":"bae84128_b462ca14","updated":"2016-02-26 00:17:17.000000000","message":"Good point.","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"66acbf92b2bee2ba9b7e6673a0f68433fdbe2568","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                          \u0027%s\u0027) % ori_value)"},{"line_number":343,"context_line":"            # NOTE(zhiyan): Check locations are all valid"},{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."},{"line_number":346,"context_line":"            for loc in value:"},{"line_number":347,"context_line":"                if ordered_value !\u003d ordered_ori:"},{"line_number":348,"context_line":"                    _check_image_location(self.context,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_24bce16b","line":345,"updated":"2016-02-26 04:01:11.000000000","message":"The code below checks all locations if new ordered list is different from original, not just new values as stated in the note.","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"8030be30eaa7c14902f45f8dfeea828003c568aa","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                          \u0027%s\u0027) % ori_value)"},{"line_number":343,"context_line":"            # NOTE(zhiyan): Check locations are all valid"},{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."},{"line_number":346,"context_line":"            for loc in value:"},{"line_number":347,"context_line":"                if ordered_value !\u003d ordered_ori:"},{"line_number":348,"context_line":"                    _check_image_location(self.context,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_b62beb2f","line":345,"in_reply_to":"9aed3d3a_24bce16b","updated":"2016-02-26 12:39:20.000000000","message":"Done","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"66acbf92b2bee2ba9b7e6673a0f68433fdbe2568","unresolved":false,"context_lines":[{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."},{"line_number":346,"context_line":"            for loc in value:"},{"line_number":347,"context_line":"                if ordered_value !\u003d ordered_ori:"},{"line_number":348,"context_line":"                    _check_image_location(self.context,"},{"line_number":349,"context_line":"                                          self.store_api,"},{"line_number":350,"context_line":"                                          self.store_utils,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_041d5d73","line":347,"updated":"2016-02-26 04:01:11.000000000","message":"We do not need to check this for each round of the loop. If it\u0027s true once it\u0027s true always.","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"8030be30eaa7c14902f45f8dfeea828003c568aa","unresolved":false,"context_lines":[{"line_number":344,"context_line":"            # NOTE(flwang): Only check if the new URL of locations are"},{"line_number":345,"context_line":"            # different from the current."},{"line_number":346,"context_line":"            for loc in value:"},{"line_number":347,"context_line":"                if ordered_value !\u003d ordered_ori:"},{"line_number":348,"context_line":"                    _check_image_location(self.context,"},{"line_number":349,"context_line":"                                          self.store_api,"},{"line_number":350,"context_line":"                                          self.store_utils,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aed3d3a_1621f74d","line":347,"in_reply_to":"9aed3d3a_041d5d73","updated":"2016-02-26 12:39:20.000000000","message":"Done","commit_id":"1f90fcf894d3e5d4327d78b0fc0e7105a8dd81fb"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"faac2e14724cf68bb90b85c51dc27fcaa7541f2a","unresolved":false,"context_lines":[{"line_number":336,"context_line":"            # update the metadata, not the URL."},{"line_number":337,"context_line":"            ordered_value \u003d sorted([loc[\u0027url\u0027] for loc in value])"},{"line_number":338,"context_line":"            ordered_ori \u003d sorted([loc[\u0027url\u0027] for loc in ori_value])"},{"line_number":339,"context_line":"            if len(ori_value) \u003e 0 and ordered_value !\u003d ordered_ori:"},{"line_number":340,"context_line":"                raise exception.Invalid(_(\"Can\u0027t change the location\u0027s url \""},{"line_number":341,"context_line":"                                          \"if the original locations \""},{"line_number":342,"context_line":"                                          \"are not empty.\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aed3d3a_b51ee65c","line":339,"updated":"2016-02-29 11:55:03.000000000","message":"Why do we need to check if they are not equal? This means that if I send the same locations in, the server won\u0027t raise an error if I try to update the existing locations when the list is not empty. This will result in an inconsistent behavior, right?\n\nCan we just check if the `ori_value` list is not empty?","commit_id":"15e3a151f78cf8dc0490d729125f1e6d03574c1d"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"bc689a2891480573a07530a79c4763d917d52eeb","unresolved":false,"context_lines":[{"line_number":336,"context_line":"            # update the metadata, not the URL."},{"line_number":337,"context_line":"            ordered_value \u003d sorted([loc[\u0027url\u0027] for loc in value])"},{"line_number":338,"context_line":"            ordered_ori \u003d sorted([loc[\u0027url\u0027] for loc in ori_value])"},{"line_number":339,"context_line":"            if len(ori_value) \u003e 0 and ordered_value !\u003d ordered_ori:"},{"line_number":340,"context_line":"                raise exception.Invalid(_(\"Can\u0027t change the location\u0027s url \""},{"line_number":341,"context_line":"                                          \"if the original locations \""},{"line_number":342,"context_line":"                                          \"are not empty.\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aed3d3a_37475a78","line":339,"in_reply_to":"9aed3d3a_b51ee65c","updated":"2016-02-29 20:44:10.000000000","message":"Talked to flwang on IRC. I missed part of the logic here.","commit_id":"15e3a151f78cf8dc0490d729125f1e6d03574c1d"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"faac2e14724cf68bb90b85c51dc27fcaa7541f2a","unresolved":false,"context_lines":[{"line_number":345,"context_line":"            # current image locations, then it\u0027s not necessary to verify those"},{"line_number":346,"context_line":"            # locations again. Otherwise, if there is any restricted scheme in"},{"line_number":347,"context_line":"            # existing locations. _check_image_location will fail."},{"line_number":348,"context_line":"            if ordered_value !\u003d ordered_ori:"},{"line_number":349,"context_line":"                for loc in value:"},{"line_number":350,"context_line":"                    _check_image_location(self.context,"},{"line_number":351,"context_line":"                                          self.store_api,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aed3d3a_95e002fc","line":348,"updated":"2016-02-29 11:55:03.000000000","message":"Again, I\u0027m not clear why we need to check this.","commit_id":"15e3a151f78cf8dc0490d729125f1e6d03574c1d"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"b4d3b57125cb89b91f9f9f25b1cca0fd7ebcda54","unresolved":false,"context_lines":[{"line_number":339,"context_line":"            if len(ori_value) \u003e 0 and ordered_value !\u003d ordered_ori:"},{"line_number":340,"context_line":"                raise exception.Invalid(_(\"Can\u0027t change the location\u0027s url \""},{"line_number":341,"context_line":"                                          \"if the original locations \""},{"line_number":342,"context_line":"                                          \"are not empty.\"))"},{"line_number":343,"context_line":"            # NOTE(zhiyan): Check locations are all valid"},{"line_number":344,"context_line":"            # NOTE(flwang): If all the URL of passed-in locations are same as"},{"line_number":345,"context_line":"            # current image locations, then it\u0027s not necessary to verify those"}],"source_content_type":"text/x-python","patch_set":12,"id":"7af24918_5ea998de","line":342,"updated":"2016-03-02 20:41:01.000000000","message":"Now we can actually return the original value to tell the user what went wrong like the current code does.","commit_id":"d40bb90a82e1d9d5bfaaac2ce858e7effb03717e"}]}
