)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":12407,"name":"Shubham Kumar Sharma","email":"shubham.git@gmail.com","username":"shubham.git"},"change_message_id":"380da1c9b6430eacbc26124e3846fd08fcdb0f1b","unresolved":false,"context_lines":[{"line_number":28,"context_line":"* Add unit test cases"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"Change-Id: Id2230fd5f7f7bc8d517581f69882ac867ba0e59b"},{"line_number":31,"context_line":"Partial-Implements: blueprint container-images"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"fa6399be_7d8b61c3","line":31,"updated":"2016-10-14 08:49:10.000000000","message":"link is broken!","commit_id":"abc355f726f2bcdb6d45e68226b7515618f9eed5"}],"zun/compute/manager.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"3e7a788435cbac60ddcbbbdf835a83eeb3f04e78","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        container.task_state \u003d fields.TaskState.IMAGE_PULLING"},{"line_number":67,"context_line":"        container.save()"},{"line_number":68,"context_line":"        try:"},{"line_number":69,"context_line":"            image_path \u003d image_driver._pull_image(context, container.image)"},{"line_number":70,"context_line":"        except exception.DockerError as e:"},{"line_number":71,"context_line":"            LOG.error(_LE(\"Error occured while calling docker API: %s\"),"},{"line_number":72,"context_line":"                      six.text_type(e))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_6e5016d5","line":69,"range":{"start_line":69,"start_character":38,"end_line":69,"end_character":49},"updated":"2016-10-07 15:28:47.000000000","message":"It looks \"_pull_image\" is a public method, so removing the \"_\" prefix will make more sense.","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d9c1de48769021cd7a734dbabc09916fe57ea5ee","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        container.task_state \u003d fields.TaskState.IMAGE_PULLING"},{"line_number":67,"context_line":"        container.save()"},{"line_number":68,"context_line":"        try:"},{"line_number":69,"context_line":"            image_path \u003d image_driver._pull_image(context, container.image)"},{"line_number":70,"context_line":"        except exception.DockerError as e:"},{"line_number":71,"context_line":"            LOG.error(_LE(\"Error occured while calling docker API: %s\"),"},{"line_number":72,"context_line":"                      six.text_type(e))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_4707b817","line":69,"range":{"start_line":69,"start_character":38,"end_line":69,"end_character":49},"in_reply_to":"1a95cdbc_6e5016d5","updated":"2016-10-07 18:23:08.000000000","message":"Done","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"3e7a788435cbac60ddcbbbdf835a83eeb3f04e78","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        container.task_state \u003d fields.TaskState.CONTAINER_CREATING"},{"line_number":81,"context_line":"        container.save()"},{"line_number":82,"context_line":"        try:"},{"line_number":83,"context_line":"            container \u003d self.driver.create(container, image_path)"},{"line_number":84,"context_line":"        except exception.DockerError as e:"},{"line_number":85,"context_line":"            LOG.error(_LE(\"Error occured while calling docker API: %s\"),"},{"line_number":86,"context_line":"                      six.text_type(e))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_4e9d1a65","line":83,"range":{"start_line":83,"start_character":54,"end_line":83,"end_character":64},"updated":"2016-10-07 15:28:47.000000000","message":"I think it is better to refactor this further:\n\n  if image_path:\n    self.docker.load_image(image_path)\n  self.driver.create(container)\n\nI think this will decouple the image loading logic from the container creation logic, which make it a bit easier to maintain.","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d9c1de48769021cd7a734dbabc09916fe57ea5ee","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        container.task_state \u003d fields.TaskState.CONTAINER_CREATING"},{"line_number":81,"context_line":"        container.save()"},{"line_number":82,"context_line":"        try:"},{"line_number":83,"context_line":"            container \u003d self.driver.create(container, image_path)"},{"line_number":84,"context_line":"        except exception.DockerError as e:"},{"line_number":85,"context_line":"            LOG.error(_LE(\"Error occured while calling docker API: %s\"),"},{"line_number":86,"context_line":"                      six.text_type(e))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_e401a207","line":83,"range":{"start_line":83,"start_character":54,"end_line":83,"end_character":64},"in_reply_to":"1a95cdbc_4e9d1a65","updated":"2016-10-07 18:23:08.000000000","message":"Hongbin, I think adding docker.load() here would not be good as we aim to support multiple container backends in future. That\u0027s why I left it to docker to load its own image.\nWhat do you say?","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"4ae17a37750c8ec886ce0f85e3f917c2327f74a4","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        container.task_state \u003d fields.TaskState.CONTAINER_CREATING"},{"line_number":81,"context_line":"        container.save()"},{"line_number":82,"context_line":"        try:"},{"line_number":83,"context_line":"            container \u003d self.driver.create(container, image_path)"},{"line_number":84,"context_line":"        except exception.DockerError as e:"},{"line_number":85,"context_line":"            LOG.error(_LE(\"Error occured while calling docker API: %s\"),"},{"line_number":86,"context_line":"                      six.text_type(e))"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_955d6649","line":83,"range":{"start_line":83,"start_character":54,"end_line":83,"end_character":64},"in_reply_to":"1a95cdbc_e401a207","updated":"2016-10-07 19:27:34.000000000","message":"I agree. Loading image is runtime-specific, so it makes sense. How about:\n\n  self.driver.load_image(image_path)\n  self.driver.create(container)\n\nThis is just a code refactor advice, and the functionality should be the same.","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"}],"zun/container/docker/driver.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"3e7a788435cbac60ddcbbbdf835a83eeb3f04e78","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    def __init__(self):"},{"line_number":34,"context_line":"        super(DockerDriver, self).__init__()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def pull_image(self, image):"},{"line_number":37,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":38,"context_line":"            LOG.debug(\u0027Pulling image %s\u0027 % image)"},{"line_number":39,"context_line":"            image_repo, image_tag \u003d docker_utils.parse_docker_image(image)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_1bb19247","line":36,"range":{"start_line":36,"start_character":8,"end_line":36,"end_character":18},"updated":"2016-10-07 15:28:47.000000000","message":"I guess this can be removed.","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d9c1de48769021cd7a734dbabc09916fe57ea5ee","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    def __init__(self):"},{"line_number":34,"context_line":"        super(DockerDriver, self).__init__()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def pull_image(self, image):"},{"line_number":37,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":38,"context_line":"            LOG.debug(\u0027Pulling image %s\u0027 % image)"},{"line_number":39,"context_line":"            image_repo, image_tag \u003d docker_utils.parse_docker_image(image)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_e718c477","line":36,"range":{"start_line":36,"start_character":8,"end_line":36,"end_character":18},"in_reply_to":"1a95cdbc_1bb19247","updated":"2016-10-07 18:23:08.000000000","message":"Done","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"}],"zun/image/docker/driver.py":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"053452321487b0489999b41bee25b95d1a360a70","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    def __init__(self):"},{"line_number":31,"context_line":"        super(DockerDriver, self).__init__()"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def pull_image(self, context, image_name):"},{"line_number":34,"context_line":"        with docker_utils.docker_client() as docker:"},{"line_number":35,"context_line":"            try:"},{"line_number":36,"context_line":"                LOG.debug(\u0027Pulling image from docker %s,\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa6399be_1d79bafc","line":33,"range":{"start_line":33,"start_character":25,"end_line":33,"end_character":33},"updated":"2016-10-20 03:50:29.000000000","message":"Seems we don\u0027t need the context in docker driver at all.","commit_id":"17ed14b34ef62f916d92cb76a30b8f1a614a7c70"}],"zun/image/driver.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"3e7a788435cbac60ddcbbbdf835a83eeb3f04e78","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            \u0027zun.image.%s\u0027 % image_driver)"},{"line_number":75,"context_line":"        if not isinstance(driver, ContainerImageDriver):"},{"line_number":76,"context_line":"            raise Exception(_(\u0027Expected driver of type: %s\u0027) %"},{"line_number":77,"context_line":"                            str(ContainerImageDriver))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        return driver"},{"line_number":80,"context_line":"    except ImportError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_a44404b7","line":77,"range":{"start_line":77,"start_character":28,"end_line":77,"end_character":53},"updated":"2016-10-07 15:28:47.000000000","message":"It seems the correct way to convert a type to string is:\n\n  type(ContainerImageDriver).__name__","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"4ae17a37750c8ec886ce0f85e3f917c2327f74a4","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            \u0027zun.image.%s\u0027 % image_driver)"},{"line_number":75,"context_line":"        if not isinstance(driver, ContainerImageDriver):"},{"line_number":76,"context_line":"            raise Exception(_(\u0027Expected driver of type: %s\u0027) %"},{"line_number":77,"context_line":"                            str(ContainerImageDriver))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        return driver"},{"line_number":80,"context_line":"    except ImportError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_3539f2f2","line":77,"range":{"start_line":77,"start_character":28,"end_line":77,"end_character":53},"in_reply_to":"1a95cdbc_476c18d0","updated":"2016-10-07 19:27:34.000000000","message":"ok... never mind.","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d9c1de48769021cd7a734dbabc09916fe57ea5ee","unresolved":false,"context_lines":[{"line_number":74,"context_line":"            \u0027zun.image.%s\u0027 % image_driver)"},{"line_number":75,"context_line":"        if not isinstance(driver, ContainerImageDriver):"},{"line_number":76,"context_line":"            raise Exception(_(\u0027Expected driver of type: %s\u0027) %"},{"line_number":77,"context_line":"                            str(ContainerImageDriver))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        return driver"},{"line_number":80,"context_line":"    except ImportError:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_476c18d0","line":77,"range":{"start_line":77,"start_character":28,"end_line":77,"end_character":53},"in_reply_to":"1a95cdbc_a44404b7","updated":"2016-10-07 18:23:08.000000000","message":"This would return \u0027classobj\u0027","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"3e7a788435cbac60ddcbbbdf835a83eeb3f04e78","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        sys.exit(1)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"def _search_image_on_host(context, image_name):"},{"line_number":86,"context_line":"    LOG.debug(\u0027Searching for image %s locally\u0027 % image_name)"},{"line_number":87,"context_line":"    images_directory \u003d CONF.images_directory"},{"line_number":88,"context_line":"    image_meta \u003d utils._find_image(context, image_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_6ee01697","line":85,"range":{"start_line":85,"start_character":4,"end_line":85,"end_character":25},"updated":"2016-10-07 15:28:47.000000000","message":"I think how to search images locally is driver-specific:\n* For Docker image driver, images can be searched by \"docker images\"\n* For Glance image driver, images can be searched by the implementation below.\n\nBased on the observations above, I suggested to define a abstract method in base class for searching images. This abstract method needs to be implemented by both GlanceImageDriver and DockerImageDriver. What do you think?","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d9c1de48769021cd7a734dbabc09916fe57ea5ee","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        sys.exit(1)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"def _search_image_on_host(context, image_name):"},{"line_number":86,"context_line":"    LOG.debug(\u0027Searching for image %s locally\u0027 % image_name)"},{"line_number":87,"context_line":"    images_directory \u003d CONF.images_directory"},{"line_number":88,"context_line":"    image_meta \u003d utils._find_image(context, image_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_e75d2416","line":85,"range":{"start_line":85,"start_character":4,"end_line":85,"end_character":25},"in_reply_to":"1a95cdbc_6ee01697","updated":"2016-10-07 18:23:08.000000000","message":"I will take care of it in next patch","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"3e7a788435cbac60ddcbbbdf835a83eeb3f04e78","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        except exception.ImageNotFound:"},{"line_number":111,"context_line":"            pass"},{"line_number":112,"context_line":"        except Exception as e:"},{"line_number":113,"context_line":"            raise exception.ZunException(str(e))"},{"line_number":114,"context_line":"    return image"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_24eb9479","line":113,"range":{"start_line":113,"start_character":28,"end_line":113,"end_character":40},"updated":"2016-10-07 15:28:47.000000000","message":"I guess the original stacktrace will lose due to re-raising the exception here. It is better to log the exception before re-raise it:\n\n  LOG.exception(...)","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d9c1de48769021cd7a734dbabc09916fe57ea5ee","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        except exception.ImageNotFound:"},{"line_number":111,"context_line":"            pass"},{"line_number":112,"context_line":"        except Exception as e:"},{"line_number":113,"context_line":"            raise exception.ZunException(str(e))"},{"line_number":114,"context_line":"    return image"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_c76ae880","line":113,"range":{"start_line":113,"start_character":28,"end_line":113,"end_character":40},"in_reply_to":"1a95cdbc_24eb9479","updated":"2016-10-07 18:23:08.000000000","message":"Done","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":12407,"name":"Shubham Kumar Sharma","email":"shubham.git@gmail.com","username":"shubham.git"},"change_message_id":"380da1c9b6430eacbc26124e3846fd08fcdb0f1b","unresolved":false,"context_lines":[{"line_number":108,"context_line":"            if image:"},{"line_number":109,"context_line":"                break"},{"line_number":110,"context_line":"        except exception.ImageNotFound:"},{"line_number":111,"context_line":"            pass"},{"line_number":112,"context_line":"        except Exception as e:"},{"line_number":113,"context_line":"            LOG.exception(_LE(\u0027Unknown exception occured while loading\u0027"},{"line_number":114,"context_line":"                              \u0027 image : %s\u0027), str(e))"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa6399be_88947143","line":111,"updated":"2016-10-14 08:49:10.000000000","message":"If image is not found in any of the path then this should not pass for the last element in the lis. What do you think?","commit_id":"abc355f726f2bcdb6d45e68226b7515618f9eed5"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"00eae5756ad21a5cc36028d80ca908e590499236","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    try:"},{"line_number":88,"context_line":"        # TODO(mkrai): Change this to search image entry in zun db"},{"line_number":89,"context_line":"        #              after the image endpoint is merged."},{"line_number":90,"context_line":"        image_meta \u003d utils._find_image(context, image_name)"},{"line_number":91,"context_line":"    except exception.ImageNotFound:"},{"line_number":92,"context_line":"        return None"},{"line_number":93,"context_line":"    if image_meta:"}],"source_content_type":"text/x-python","patch_set":8,"id":"da6895a0_a29b6971","line":90,"updated":"2016-10-25 05:14:44.000000000","message":"I think its find_image not _find_image, am i wrong?","commit_id":"1b072d06c2fe1ee236e820664d46f5a8646d1a1d"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"089deec191ac2daccb73692cd5a0a73af4401577","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"image_driver_opts \u003d ["},{"line_number":32,"context_line":"    cfg.ListOpt(\u0027image_driver_list\u0027,"},{"line_number":33,"context_line":"                default\u003d[\u0027glance.driver.GlanceDriver\u0027],"},{"line_number":34,"context_line":"                help\u003d\"\"\"Defines the list of image driver to use for downloading image."},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"Possible values:"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba5da102_c69ee006","line":33,"range":{"start_line":33,"start_character":16,"end_line":33,"end_character":23},"updated":"2016-11-06 16:58:04.000000000","message":"@Madhuri,\n\nI think the default should be both \u0027glance.driver.GlanceDriver\u0027 and \u0027docker.driver.DockerDriver\u0027, although the Glance driver can be in a higher priority.\n\nThis is because most users expect to pull images from docker hub. If we doesn\u0027t enable it by default, it will turn around some users :)","commit_id":"b63f7c92935625b3dd478d23c9cd8ff45ed52728"}],"zun/image/glance/driver.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"3e7a788435cbac60ddcbbbdf835a83eeb3f04e78","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        try:"},{"line_number":64,"context_line":"            out_path \u003d os.path.join(images_directory, image_meta.id + \u0027.tar\u0027)"},{"line_number":65,"context_line":"            with open(out_path, \u0027wb\u0027) as fd:"},{"line_number":66,"context_line":"                for chunk in image_chunks:"},{"line_number":67,"context_line":"                    fd.write(chunk)"},{"line_number":68,"context_line":"        except Exception as e:"},{"line_number":69,"context_line":"            msg \u003d _(\u0027Error occured while writing image: {0}\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_58efa0e8","line":66,"range":{"start_line":66,"start_character":29,"end_line":66,"end_character":41},"updated":"2016-10-07 15:28:47.000000000","message":"Could the image_chunks be None? If yes, it needs a check here.","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d9c1de48769021cd7a734dbabc09916fe57ea5ee","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        try:"},{"line_number":64,"context_line":"            out_path \u003d os.path.join(images_directory, image_meta.id + \u0027.tar\u0027)"},{"line_number":65,"context_line":"            with open(out_path, \u0027wb\u0027) as fd:"},{"line_number":66,"context_line":"                for chunk in image_chunks:"},{"line_number":67,"context_line":"                    fd.write(chunk)"},{"line_number":68,"context_line":"        except Exception as e:"},{"line_number":69,"context_line":"            msg \u003d _(\u0027Error occured while writing image: {0}\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_e7ec44f5","line":66,"range":{"start_line":66,"start_character":29,"end_line":66,"end_character":41},"in_reply_to":"1a95cdbc_58efa0e8","updated":"2016-10-07 18:23:08.000000000","message":"I will check on this and update in next patch.","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"3e7a788435cbac60ddcbbbdf835a83eeb3f04e78","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            msg \u003d _(\u0027Error occured while writing image: {0}\u0027)"},{"line_number":70,"context_line":"            raise exception.ZunException(msg.format(e))"},{"line_number":71,"context_line":"        finally:"},{"line_number":72,"context_line":"            fd.close()"},{"line_number":73,"context_line":"        LOG.debug(\u0027Image %s was downloaded to path : %s\u0027"},{"line_number":74,"context_line":"                  % (image_name, out_path))"},{"line_number":75,"context_line":"        return out_path"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_58bc0006","line":72,"range":{"start_line":72,"start_character":12,"end_line":72,"end_character":14},"updated":"2016-10-07 15:28:47.000000000","message":"I see you open the file by using \"with\". The \"with\" statement should take care of closing the file, so I guess you don\u0027t need to close it here.","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":10206,"name":"Madhuri Kumari","email":"madhuri.kumari@intel.com","username":"Madhuri"},"change_message_id":"d9c1de48769021cd7a734dbabc09916fe57ea5ee","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            msg \u003d _(\u0027Error occured while writing image: {0}\u0027)"},{"line_number":70,"context_line":"            raise exception.ZunException(msg.format(e))"},{"line_number":71,"context_line":"        finally:"},{"line_number":72,"context_line":"            fd.close()"},{"line_number":73,"context_line":"        LOG.debug(\u0027Image %s was downloaded to path : %s\u0027"},{"line_number":74,"context_line":"                  % (image_name, out_path))"},{"line_number":75,"context_line":"        return out_path"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a95cdbc_07bcd0da","line":72,"range":{"start_line":72,"start_character":12,"end_line":72,"end_character":14},"in_reply_to":"1a95cdbc_58bc0006","updated":"2016-10-07 18:23:08.000000000","message":"Done","commit_id":"5e9087242ef097fca26ce168159c8eb2355a135e"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"053452321487b0489999b41bee25b95d1a360a70","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    def pull_image(self, context, image_name):"},{"line_number":51,"context_line":"        LOG.debug(\u0027Pulling image from glance %s\u0027 % image_name)"},{"line_number":52,"context_line":"        try:"},{"line_number":53,"context_line":"            self._glance \u003d utils._create_glanceclient(context)"},{"line_number":54,"context_line":"            image_meta \u003d utils._find_image(context, image_name)"},{"line_number":55,"context_line":"            LOG.debug(\u0027Image %s was found in glance, downloading now...\u0027"},{"line_number":56,"context_line":"                      % image_name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa6399be_dd2022fa","line":53,"range":{"start_line":53,"start_character":12,"end_line":53,"end_character":62},"updated":"2016-10-20 03:50:29.000000000","message":"Not sure why we need to set a member variable every time we do pull_image?\n\ncan we:\n\n1) make this as a local variable\n2) or set it in __init__ (not sure if that would work, since you need a context)","commit_id":"17ed14b34ef62f916d92cb76a30b8f1a614a7c70"}],"zun/image/glance/utils.py":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"053452321487b0489999b41bee25b95d1a360a70","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from zun.common.i18n import _LE"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def _create_glanceclient(context):"},{"line_number":24,"context_line":"    \"\"\"Creates glance client object."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"        :param context: context to create client object"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa6399be_7d38f63d","line":23,"range":{"start_line":23,"start_character":4,"end_line":23,"end_character":24},"updated":"2016-10-20 03:50:29.000000000","message":"for functions in utils, it should be public functions, remove _ from function naming.","commit_id":"17ed14b34ef62f916d92cb76a30b8f1a614a7c70"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"053452321487b0489999b41bee25b95d1a360a70","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    return osc.glance()"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def _find_image(context, image_ident):"},{"line_number":34,"context_line":"    glance \u003d _create_glanceclient(context)"},{"line_number":35,"context_line":"    if uuidutils.is_uuid_like(image_ident):"},{"line_number":36,"context_line":"        image_meta \u003d glance.images.get(image_ident)"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa6399be_bd3a8e32","line":33,"range":{"start_line":33,"start_character":4,"end_line":33,"end_character":5},"updated":"2016-10-20 03:50:29.000000000","message":"ditto","commit_id":"17ed14b34ef62f916d92cb76a30b8f1a614a7c70"}]}
