)]}'
{"glance_store/_drivers/swift/store.py":[{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"b3cd2f227619714b1cbea2b9c40820651574f60a","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                  \"to Swift\" % dict(obj_name\u003dlocation.obj))"},{"line_number":509,"context_line":"        try:"},{"line_number":510,"context_line":"            if (image_size \u003e 0 and image_size \u003c self.large_object_size"},{"line_number":511,"context_line":"                    and verifier is None):"},{"line_number":512,"context_line":"                # Image size is known, and is less than large_object_size."},{"line_number":513,"context_line":"                # Send to Swift with regular PUT."},{"line_number":514,"context_line":"                obj_etag \u003d connection.put_object(location.container,"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a5de9d1_11753697","line":511,"updated":"2016-01-28 11:48:31.000000000","message":"I am not sure we need \"verifier is None\" here.\nIf I have 10 Mb image with verifier then I need to split it into chunks. Is it intended by feature design?\nPlease also note that image_size is known for V1 API: so we will be here only for V1 API.","commit_id":"94bcafbc3d8ac0f97a828b775d6c27f18af1e46b"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"757de74cd34f2f706cfcc7d4a7e735bb56abea1d","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                  \"to Swift\" % dict(obj_name\u003dlocation.obj))"},{"line_number":509,"context_line":"        try:"},{"line_number":510,"context_line":"            if (image_size \u003e 0 and image_size \u003c self.large_object_size"},{"line_number":511,"context_line":"                    and verifier is None):"},{"line_number":512,"context_line":"                # Image size is known, and is less than large_object_size."},{"line_number":513,"context_line":"                # Send to Swift with regular PUT."},{"line_number":514,"context_line":"                obj_etag \u003d connection.put_object(location.container,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a57f1b5_ca91dcf2","line":511,"in_reply_to":"3a57f1b5_03f3ba9f","updated":"2016-02-11 21:43:47.000000000","message":"It looks like I was not clear, sorry for that.\nIf image size is small (say 4 Gb) glance_store needs to split the image into 200 Mb chunks just because of verifier. It seems not optimal to me. \nAFAIU, you need to call verifier.update when reading image_file. You can wrap image_file into ChunkReader and pass that reader to put_object(see line 551) like this:\nchecksum \u003d hashlib.md5()\nreader \u003d ChunkReader(image_file, checksum, image_size, verifier)\nconnection.put_object(container, obj, reader, image_size).\nYou can also replace ChunkReader with any other wrapper with read method.\n\nI prefer this solution because of first point(about splitting image in chunks).\nMoreover, glance_store need to create obj etag at line 508 just because of verifier. I am not sure if it can lead to troubles in Swift (need to test it).\n\nPlease also note that image_size is not None only for v1 API (AFAIK it is used together with --copy-from functionality). So: if verifier must be used with v1 then you are changing default v1 behavior which is not good. If verifier is not used with v1 API then we don\u0027t need this check at all because image_size is always 0 for v2 API AFAIK.\n\nSo let\u0027s see if other folks have different opinion\u003d)","commit_id":"94bcafbc3d8ac0f97a828b775d6c27f18af1e46b"},{"author":{"_account_id":15524,"name":"dane-fichter","email":"dane.fichter@jhuapl.edu","username":"dane-fichter"},"change_message_id":"6d60463a194ba5a88dabc7cdf2a935c55ba43c16","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                  \"to Swift\" % dict(obj_name\u003dlocation.obj))"},{"line_number":509,"context_line":"        try:"},{"line_number":510,"context_line":"            if (image_size \u003e 0 and image_size \u003c self.large_object_size"},{"line_number":511,"context_line":"                    and verifier is None):"},{"line_number":512,"context_line":"                # Image size is known, and is less than large_object_size."},{"line_number":513,"context_line":"                # Send to Swift with regular PUT."},{"line_number":514,"context_line":"                obj_etag \u003d connection.put_object(location.container,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a57f1b5_03f3ba9f","line":511,"in_reply_to":"3a57f1b5_117552ca","updated":"2016-02-10 14:34:59.000000000","message":"All this patch does is allow image signature verification for small images. I can update the commit message to make that clearer if that\u0027s unclear.\n\nWithout this patch, a small image with signature metadata would follow this code path, which already existed for small images, and the signature would not be verified. If you\u0027re not using signature verification, then this change doesn\u0027t change anything about how your download occurs.","commit_id":"94bcafbc3d8ac0f97a828b775d6c27f18af1e46b"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"cffbc6bc102a71e10838aa495966893a0527caf2","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                  \"to Swift\" % dict(obj_name\u003dlocation.obj))"},{"line_number":509,"context_line":"        try:"},{"line_number":510,"context_line":"            if (image_size \u003e 0 and image_size \u003c self.large_object_size"},{"line_number":511,"context_line":"                    and verifier is None):"},{"line_number":512,"context_line":"                # Image size is known, and is less than large_object_size."},{"line_number":513,"context_line":"                # Send to Swift with regular PUT."},{"line_number":514,"context_line":"                obj_etag \u003d connection.put_object(location.container,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_6625e3ac","line":511,"in_reply_to":"5a5ae5dd_14c5065a","updated":"2016-02-09 14:58:05.000000000","message":"Ok, got it, so verifier should redirect us to else condition despite of image_size.\nIt looks like verifier will be always applied for glance v2 API (which has verifier functionality) because of this:\nhttps://github.com/openstack/glance/blob/master/glance/api/v2/image_data.py#L277.\nSo we will be here only for v1 API. HTH, but i need some additional analysis for that.","commit_id":"94bcafbc3d8ac0f97a828b775d6c27f18af1e46b"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"6a25d8e330aa23748fdc5ecb3296174a493888ec","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                  \"to Swift\" % dict(obj_name\u003dlocation.obj))"},{"line_number":509,"context_line":"        try:"},{"line_number":510,"context_line":"            if (image_size \u003e 0 and image_size \u003c self.large_object_size"},{"line_number":511,"context_line":"                    and verifier is None):"},{"line_number":512,"context_line":"                # Image size is known, and is less than large_object_size."},{"line_number":513,"context_line":"                # Send to Swift with regular PUT."},{"line_number":514,"context_line":"                obj_etag \u003d connection.put_object(location.container,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a57f1b5_117552ca","line":511,"in_reply_to":"5a5ae5dd_6625e3ac","updated":"2016-02-10 09:49:30.000000000","message":"So after additional analysis I am wondering if the current approach can be enhanced.\nAccording to the current impl if verifier is not None we should create ETag and use chunks (BTW, it is better to explain in commit message) i.e. go to \"else\" condition.\nIs it possible to wrap image_file with some class that provides \"read\" method and updates verifier here? it allows us not to create ETag at line 509 and do not use chunked requests. It also seems more proper for current commit message.","commit_id":"94bcafbc3d8ac0f97a828b775d6c27f18af1e46b"},{"author":{"_account_id":15524,"name":"dane-fichter","email":"dane.fichter@jhuapl.edu","username":"dane-fichter"},"change_message_id":"412384fc836ace563f86f315667ee02adb7ad9c3","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                  \"to Swift\" % dict(obj_name\u003dlocation.obj))"},{"line_number":509,"context_line":"        try:"},{"line_number":510,"context_line":"            if (image_size \u003e 0 and image_size \u003c self.large_object_size"},{"line_number":511,"context_line":"                    and verifier is None):"},{"line_number":512,"context_line":"                # Image size is known, and is less than large_object_size."},{"line_number":513,"context_line":"                # Send to Swift with regular PUT."},{"line_number":514,"context_line":"                obj_etag \u003d connection.put_object(location.container,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a5ae5dd_14c5065a","line":511,"in_reply_to":"7a5de9d1_11753697","updated":"2016-02-04 13:59:24.000000000","message":"Hello Kairat, I\u0027m taking over this patch for Brianna while she\u0027s out. Can you clarify what you mean here? The purpose of adding \"verifier is None\" here is to preserve this code path for small images in the case where image signature verification isn\u0027t occurring, but to allow verification to occur for small images when desired.","commit_id":"94bcafbc3d8ac0f97a828b775d6c27f18af1e46b"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"b1f5c95edf8aee43563b530d55b80d14c9c1de79","unresolved":false,"context_lines":[{"line_number":507,"context_line":"        LOG.debug(\"Adding image object \u0027%(obj_name)s\u0027 \""},{"line_number":508,"context_line":"                  \"to Swift\" % dict(obj_name\u003dlocation.obj))"},{"line_number":509,"context_line":"        try:"},{"line_number":510,"context_line":"            if (image_size \u003e 0 and image_size \u003c self.large_object_size):"},{"line_number":511,"context_line":"                # Image size is known, and is less than large_object_size."},{"line_number":512,"context_line":"                # Send to Swift with regular PUT."},{"line_number":513,"context_line":"                if verifier:"}],"source_content_type":"text/x-python","patch_set":7,"id":"dae33548_8ba42cba","line":510,"updated":"2016-02-18 07:06:08.000000000","message":"Looks like parenthesis is redundant.\nYou can omit them in python\u003d).","commit_id":"f2b84d2ad63b05ce7727f14163de5cb00750d09c"},{"author":{"_account_id":14676,"name":"Kairat Kushaev","email":"kkushaev@mirantis.com","username":"kairat_kushaev"},"change_message_id":"b1f5c95edf8aee43563b530d55b80d14c9c1de79","unresolved":false,"context_lines":[{"line_number":510,"context_line":"            if (image_size \u003e 0 and image_size \u003c self.large_object_size):"},{"line_number":511,"context_line":"                # Image size is known, and is less than large_object_size."},{"line_number":512,"context_line":"                # Send to Swift with regular PUT."},{"line_number":513,"context_line":"                if verifier:"},{"line_number":514,"context_line":"                    checksum \u003d hashlib.md5()"},{"line_number":515,"context_line":"                    reader \u003d ChunkReader(image_file, checksum,"},{"line_number":516,"context_line":"                                         image_size, verifier)"}],"source_content_type":"text/x-python","patch_set":7,"id":"dae33548_8b66ec27","line":513,"updated":"2016-02-18 07:06:08.000000000","message":"Looks like we won\u0027t have verifier for v1 according to specification: https://review.openstack.org/#/c/252462/4/specs/mitaka/approved/image-signing-and-verification-support.rst.\nBut I tend to agree that we still need it because glance_store is separate lib and might be used by other projects.","commit_id":"f2b84d2ad63b05ce7727f14163de5cb00750d09c"}]}
