)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Giulio Fidente \u003cgfidente@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-12-06 18:50:40 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Ensure posted size is compared with remote size and kills if different"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch ensures the posted size is compared with downloaded imag"},{"line_number":10,"context_line":"size when using --copy-from and kills the image if size differs"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAATn%2F9uHw%3D","line":7,"updated":"2013-12-06 19:59:42.000000000","message":"too long, title should be 50 chars or less","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Ensure posted size is compared with remote size and kills if different"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch ensures the posted size is compared with downloaded imag"},{"line_number":10,"context_line":"size when using --copy-from and kills the image if size differs"},{"line_number":11,"context_line":"(behaving consistently with uploads from posted data)."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAATn%2F9uIE%3D","line":9,"updated":"2013-12-06 19:59:42.000000000","message":"typo for intended word \"image\"","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":15,"context_line":"the value calculated from image data."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I08cef2143a5963c3f3c3412208cf3376299f2231"},{"line_number":18,"context_line":"Close-Bug: 1256593"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAATn%2F9uHk%3D","line":18,"updated":"2013-12-06 19:59:42.000000000","message":"did not auto recognize the bug from the number\n\ntry using \"fixes bug 1256593\" (without any special chars)","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"}],"glance/api/v1/images.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"253ca04b336d74ba1082ba65a1edf63e628ed38c","unresolved":false,"context_lines":[{"line_number":550,"context_line":"                msg \u003d _(\"Copy from external source failed: %s\") % e"},{"line_number":551,"context_line":"                LOG.debug(msg)"},{"line_number":552,"context_line":"                return"},{"line_number":553,"context_line":"            image_meta[\u0027size\u0027] \u003d image_meta[\u0027size\u0027] or image_size"},{"line_number":554,"context_line":"        else:"},{"line_number":555,"context_line":"            try:"},{"line_number":556,"context_line":"                req.get_content_type((\u0027application/octet-stream\u0027,))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BJ8g%3D","line":553,"updated":"2013-12-01 04:08:15.000000000","message":"I\u0027m open on this point, but I\u0027d like share my thoughts at here.\n\nI personally tend to check size at here like what I did at [1] since end user can get an error message clearly and immediately. Under you change, actually end user can\u0027t get any error response even though them pass a wrong size argument value into glance, the image will transform from \u0027queued\u0027 to \u0027killed\u0027 status automatically by glance background thread [2] and only an exception be wrote to log [3]. This behavior is different than before, you know old code can fix wrong image size automatically and make its status change to \u0027active\u0027 as end user expected. so IMO if we do the checking at here, we can allow end user know what\u0027s wrong there.\n\n[1] https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L671\n\n[2] http://paste.openstack.org/show/54222/\n\n[3] http://paste.openstack.org/show/54223/\n\nthanks","commit_id":"6df09a79af0113d2cbe47723496f42ef4df01598"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":548,"context_line":"                msg \u003d _(\"Copy from external source failed: %s\") % e"},{"line_number":549,"context_line":"                LOG.debug(msg)"},{"line_number":550,"context_line":"                return"},{"line_number":551,"context_line":"            image_meta[\u0027size\u0027] \u003d image_meta[\u0027size\u0027] or image_size"},{"line_number":552,"context_line":"        else:"},{"line_number":553,"context_line":"            try:"},{"line_number":554,"context_line":"                req.get_content_type((\u0027application/octet-stream\u0027,))"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9t1s%3D","line":551,"updated":"2013-12-06 19:59:42.000000000","message":"I still fail to understand how image_meta[\u0027size\u0027] is being validated either by this module or upload_utils. \n\nCan you please elaborate how preferring user specified image_meta[\u0027size\u0027] helps in the validation? I\u0027m sorry if missed something obvious.","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"}],"glance/api/v1/upload_utils.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    # as it can be chosen arbitrarily by the user"},{"line_number":88,"context_line":"    image_size \u003d None"},{"line_number":89,"context_line":"    try:"},{"line_number":90,"context_line":"        image_size \u003d len(image_data)"},{"line_number":91,"context_line":"    except TypeError:"},{"line_number":92,"context_line":"        LOG.warn(\"Could not determine size of data to be uploaded \""},{"line_number":93,"context_line":"                 \"for image %s\" % image_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9ty4%3D","line":90,"updated":"2013-12-06 19:59:42.000000000","message":"I\u0027m not sure if len(image_data) would be the best way to read the size of a big image file.\n\nOTOH, I found this article about os.path.get_size() failing on some linux systems for large files:-\n\nhttp://stackoverflow.com/questions/5579407/os-path-getsize-returns-negative-filesize-for-large-files-for-3gb-file-size\n\nSo, I really dunno what the best way to get the size is (prolly the iterator way used in other places)","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":89,"context_line":"    try:"},{"line_number":90,"context_line":"        image_size \u003d len(image_data)"},{"line_number":91,"context_line":"    except TypeError:"},{"line_number":92,"context_line":"        LOG.warn(\"Could not determine size of data to be uploaded \""},{"line_number":93,"context_line":"                 \"for image %s\" % image_id)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9uCc%3D","line":92,"updated":"2013-12-06 19:59:42.000000000","message":"need translation conversion\n\nmay be this would help:\n\nsome_var \u003d \u0027hello\u0027\n\nmsg \u003d _(\"my %(var) str\") % {\u0027var\u0027: some_var}\n\nLOG.warn(msg)","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":106,"context_line":"         locations_metadata) \u003d glance.store.store_add_to_backend("},{"line_number":107,"context_line":"             image_meta[\u0027id\u0027],"},{"line_number":108,"context_line":"             utils.CooperativeReader(image_data),"},{"line_number":109,"context_line":"             image_size,"},{"line_number":110,"context_line":"             store)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        # recheck quota in case we were unable to determine it before"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9txA%3D","line":109,"updated":"2013-12-06 19:59:42.000000000","message":"So, I\u0027m not sure if image_size is checked at places in the different store codes for None type and 0 value. Can you please look into this of what might be consequences of using 0 vs. None here?\n\n(I saw the default value of image_size as None on line 88)","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"}],"glance/tests/unit/v1/test_upload_utils.py":[{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        image_meta \u003d {\u0027id\u0027: unit_test_utils.UUID1,"},{"line_number":104,"context_line":"                      \u0027size\u0027: size}"},{"line_number":105,"context_line":"        image_data \u003d \"blah\""},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        notifier \u003d self.mox.CreateMockAnything()"},{"line_number":108,"context_line":"        store \u003d self.mox.CreateMockAnything()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9twQ%3D","line":105,"updated":"2013-12-06 19:59:42.000000000","message":"can you please move the size var beneath the image_data to be more explicit?","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        image_meta \u003d {\u0027id\u0027: unit_test_utils.UUID1,"},{"line_number":138,"context_line":"                      \u0027size\u0027: size + 1}  # Need incorrect size for test"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        image_data \u003d \"blah\""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        notifier \u003d self.mox.CreateMockAnything()"},{"line_number":143,"context_line":"        store \u003d self.mox.CreateMockAnything()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9twI%3D","line":140,"updated":"2013-12-06 19:59:42.000000000","message":"same as line 105","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        req \u003d unit_test_utils.get_fake_request()"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        location \u003d \"file://foo/bar\""},{"line_number":167,"context_line":"        size \u003d 4"},{"line_number":168,"context_line":"        checksum \u003d \"checksum\""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        image_meta \u003d {\u0027id\u0027: unit_test_utils.UUID1,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9tw0%3D","line":167,"updated":"2013-12-06 19:59:42.000000000","message":"May be we should have a different unit test for size as this checks for incorrect checksum.","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        image_meta \u003d {\u0027id\u0027: unit_test_utils.UUID1,"},{"line_number":206,"context_line":"                      \u0027size\u0027: size}"},{"line_number":207,"context_line":"        image_data \u003d \"blah\""},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        notifier \u003d self.mox.CreateMockAnything()"},{"line_number":210,"context_line":"        store \u003d self.mox.CreateMockAnything()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9twE%3D","line":207,"updated":"2013-12-06 19:59:42.000000000","message":"same as line 105","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        image_meta \u003d {\u0027id\u0027: unit_test_utils.UUID1,"},{"line_number":236,"context_line":"                      \u0027size\u0027: size}"},{"line_number":237,"context_line":"        image_data \u003d \"blah\""},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        store \u003d self.mox.CreateMockAnything()"},{"line_number":240,"context_line":"        store.add("}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9twA%3D","line":237,"updated":"2013-12-06 19:59:42.000000000","message":"same as line 105","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"4b9c833fce7feea00b03866548b0e224080b40de","unresolved":false,"context_lines":[{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        image_meta \u003d {\u0027id\u0027: unit_test_utils.UUID1,"},{"line_number":311,"context_line":"                      \u0027size\u0027: size}"},{"line_number":312,"context_line":"        image_data \u003d \"blah\""},{"line_number":313,"context_line":""},{"line_number":314,"context_line":"        notifier \u003d self.mox.CreateMockAnything()"},{"line_number":315,"context_line":"        store \u003d self.mox.CreateMockAnything()"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAATn%2F9tv8%3D","line":312,"updated":"2013-12-06 19:59:42.000000000","message":"same as line 105","commit_id":"b9ef2b7e89b3787f025c4acd66d99c3a556fb498"}]}
