)]}'
{"glance_store/_drivers/cinder.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6b5f079c4fb22ce4eb7883a7fae05242346007a6","unresolved":false,"context_lines":[{"line_number":834,"context_line":"        checksum \u003d hashlib.md5()"},{"line_number":835,"context_line":"        bytes_written \u003d 0"},{"line_number":836,"context_line":"        with tempfile.NamedTemporaryFile() as temp_image:"},{"line_number":837,"context_line":"            with open(temp_image.name, \u0027wb\u0027) as f:"},{"line_number":838,"context_line":"                while True:"},{"line_number":839,"context_line":"                    buf \u003d image_file.read(self.WRITE_CHUNKSIZE)"},{"line_number":840,"context_line":"                    if not buf:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f621f24_bf6ff290","line":837,"updated":"2020-10-28 15:36:52.000000000","message":"You can just use temp_image itself, which is a file, you do not need to open it again.","commit_id":"7375929a9b78237ec0491624ff5ee193608c81a6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6b5f079c4fb22ce4eb7883a7fae05242346007a6","unresolved":false,"context_lines":[{"line_number":840,"context_line":"                    if not buf:"},{"line_number":841,"context_line":"                        break"},{"line_number":842,"context_line":"                    f.write(buf)"},{"line_number":843,"context_line":"                image_size \u003d os.stat(temp_image.name).st_size"},{"line_number":844,"context_line":"        size_gb \u003d int(math.ceil(float(image_size) / units.Gi))"},{"line_number":845,"context_line":"        if size_gb \u003d\u003d 0:"},{"line_number":846,"context_line":"            size_gb \u003d 1"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f621f24_5f04dec6","line":843,"updated":"2020-10-28 15:36:52.000000000","message":"Are you writing this out just to get the image size? That\u0027s enormously wasteful, if so. We have image_size passed into this function already right? Is that somehow different than the size you read here?","commit_id":"7375929a9b78237ec0491624ff5ee193608c81a6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"14902fd7f3a87ca761752b47d9960f3b24e8a30a","unresolved":false,"context_lines":[{"line_number":840,"context_line":"                    if not buf:"},{"line_number":841,"context_line":"                        break"},{"line_number":842,"context_line":"                    f.write(buf)"},{"line_number":843,"context_line":"                image_size \u003d os.stat(temp_image.name).st_size"},{"line_number":844,"context_line":"        size_gb \u003d int(math.ceil(float(image_size) / units.Gi))"},{"line_number":845,"context_line":"        if size_gb \u003d\u003d 0:"},{"line_number":846,"context_line":"            size_gb \u003d 1"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f621f24_5f133eb9","line":843,"in_reply_to":"1f621f24_5f04dec6","updated":"2020-10-28 15:59:55.000000000","message":"Ignore this, I understand why image_size as passed in may not be correct for image upload type operations.","commit_id":"7375929a9b78237ec0491624ff5ee193608c81a6"}]}
