)]}'
{"zun/image/glance/driver.py":[{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"f8751dddaa21179f69cbb998339c5221e6c0e0d6","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        if not common_utils.should_pull_image(image_pull_policy, bool(image)):"},{"line_number":60,"context_line":"            if image:"},{"line_number":61,"context_line":"                LOG.debug(\u0027Image  %s present locally\u0027 % repo)"},{"line_number":62,"context_line":"                return image"},{"line_number":63,"context_line":"            else:"},{"line_number":64,"context_line":"                message \u003d _(\u0027Image %s not present with pull policy of Never\u0027"},{"line_number":65,"context_line":"                            ) % repo"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_e6ac7237","line":62,"range":{"start_line":62,"start_character":16,"end_line":62,"end_character":28},"updated":"2017-03-09 04:54:42.000000000","message":"i think hash should be checked here.","commit_id":"3ab9fefed9ef7e286de66877850ee94cf5657682"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"42c2715131f599b30113eae040a271b235142bde","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        if not common_utils.should_pull_image(image_pull_policy, bool(image)):"},{"line_number":60,"context_line":"            if image:"},{"line_number":61,"context_line":"                LOG.debug(\u0027Image  %s present locally\u0027 % repo)"},{"line_number":62,"context_line":"                return image"},{"line_number":63,"context_line":"            else:"},{"line_number":64,"context_line":"                message \u003d _(\u0027Image %s not present with pull policy of Never\u0027"},{"line_number":65,"context_line":"                            ) % repo"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_7d9b4818","line":62,"range":{"start_line":62,"start_character":16,"end_line":62,"end_character":28},"in_reply_to":"9a30ddce_e6ac7237","updated":"2017-03-12 02:18:48.000000000","message":"Done","commit_id":"3ab9fefed9ef7e286de66877850ee94cf5657682"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"3a277a5f1bd3f37d4ba01069af53506793920888","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        if not common_utils.should_pull_image(image_pull_policy, bool(image)):"},{"line_number":60,"context_line":"            if image:"},{"line_number":61,"context_line":"                LOG.debug(\u0027Image  %s present locally\u0027 % repo)"},{"line_number":62,"context_line":"                return image"},{"line_number":63,"context_line":"            else:"},{"line_number":64,"context_line":"                message \u003d _(\u0027Image %s not present with pull policy of Never\u0027"},{"line_number":65,"context_line":"                            ) % repo"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_054de1c3","line":62,"range":{"start_line":62,"start_character":16,"end_line":62,"end_character":28},"in_reply_to":"9a30ddce_e6ac7237","updated":"2017-03-09 17:20:15.000000000","message":"Yes, the image returned here needs a hash check as well. \n\nThis makes me think if it is reasonable to replace image policy checking with hash checking in this driver. Right now, we have three policies \"always\", \"ifnotpresent\", and \"never\". I recalled that we introduced different policies because we don\u0027t know if the image that was locally presented is the latest image in remote repository (i.e. glance, dockerhub). If we implemented hash checking (glance only), \"always\" doesn\u0027t seem to make sense since the image won\u0027t be always pulled (if hash is matching). I am not sure if there is any use case for \"never\" in glance. It looks \"ifnotpresent\" will be the only policy so others can be removed or ignored.\n\nThoughts on this?","commit_id":"3ab9fefed9ef7e286de66877850ee94cf5657682"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"f8751dddaa21179f69cbb998339c5221e6c0e0d6","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            image_path \u003d image[\u0027path\u0027]"},{"line_number":70,"context_line":"            image_checksum \u003d image[\u0027checksum\u0027]"},{"line_number":71,"context_line":"            md5sum \u003d hashlib.md5()"},{"line_number":72,"context_line":"            with open(image_path, \u0027rb\u0027) as fd:"},{"line_number":73,"context_line":"                md5sum.update(fd.read())"},{"line_number":74,"context_line":"            md5sum \u003d md5sum.hexdigest()"},{"line_number":75,"context_line":"            if md5sum \u003d\u003d image_checksum:"},{"line_number":76,"context_line":"                image_loaded \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_86a01645","line":73,"range":{"start_line":72,"start_character":12,"end_line":73,"end_character":39},"updated":"2017-03-09 04:54:42.000000000","message":"can we do it in chunks?","commit_id":"3ab9fefed9ef7e286de66877850ee94cf5657682"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"42c2715131f599b30113eae040a271b235142bde","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            image_path \u003d image[\u0027path\u0027]"},{"line_number":70,"context_line":"            image_checksum \u003d image[\u0027checksum\u0027]"},{"line_number":71,"context_line":"            md5sum \u003d hashlib.md5()"},{"line_number":72,"context_line":"            with open(image_path, \u0027rb\u0027) as fd:"},{"line_number":73,"context_line":"                md5sum.update(fd.read())"},{"line_number":74,"context_line":"            md5sum \u003d md5sum.hexdigest()"},{"line_number":75,"context_line":"            if md5sum \u003d\u003d image_checksum:"},{"line_number":76,"context_line":"                image_loaded \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_9d9e3c05","line":73,"range":{"start_line":72,"start_character":12,"end_line":73,"end_character":39},"in_reply_to":"9a30ddce_86a01645","updated":"2017-03-12 02:18:48.000000000","message":"Done","commit_id":"3ab9fefed9ef7e286de66877850ee94cf5657682"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"c1d9150257fe598968cf8ea88a755f29d15fac73","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            with open(image_path, \u0027rb\u0027) as fd:"},{"line_number":68,"context_line":"                while True:"},{"line_number":69,"context_line":"                    # read 10MB of data each time"},{"line_number":70,"context_line":"                    data \u003d fd.read(10 * 1024 * 1024)"},{"line_number":71,"context_line":"                    if not data:"},{"line_number":72,"context_line":"                        break"},{"line_number":73,"context_line":"                    md5sum.update(data)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a30ddce_8e98c46b","line":70,"range":{"start_line":70,"start_character":35,"end_line":70,"end_character":51},"updated":"2017-03-12 14:54:29.000000000","message":"any specific reason for 10MB?","commit_id":"ffbe3a0fe49e24c47e0f39b738c512ac08073b82"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"633a2c471baf97d2c32a8ef2ae58d282fcbe03e3","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            with open(image_path, \u0027rb\u0027) as fd:"},{"line_number":68,"context_line":"                while True:"},{"line_number":69,"context_line":"                    # read 10MB of data each time"},{"line_number":70,"context_line":"                    data \u003d fd.read(10 * 1024 * 1024)"},{"line_number":71,"context_line":"                    if not data:"},{"line_number":72,"context_line":"                        break"},{"line_number":73,"context_line":"                    md5sum.update(data)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a30ddce_046cb59a","line":70,"range":{"start_line":70,"start_character":35,"end_line":70,"end_character":51},"in_reply_to":"9a30ddce_8e98c46b","updated":"2017-03-12 21:55:46.000000000","message":"There is no specific reason. I just tried to just the optimal size, although I think this should be configurable in the future.","commit_id":"ffbe3a0fe49e24c47e0f39b738c512ac08073b82"}]}
