)]}'
{"ironic/common/glance_service/base_image_service.py":[{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"6e49a80a48b2c9fb25529fd7ce82c41874bab9cf","unresolved":false,"context_lines":[{"line_number":217,"context_line":"                return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        image_chunks \u003d self.call(method, image_id)"},{"line_number":220,"context_line":"        if image_chunks is None:"},{"line_number":221,"context_line":"            raise exception.ImageDownloadFailed("},{"line_number":222,"context_line":"                image_href\u003dimage_href, reason\u003d_(\u0027image contains no data.\u0027))"},{"line_number":223,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f91af0f_68174053","line":220,"updated":"2018-01-04 15:59:35.000000000","message":"You should check \u0027image_chunks.wrapped is None\u0027, because the method returns a proxy object which is never None: https://github.com/openstack/python-glanceclient/blob/master/glanceclient/common/utils.py#L481-L50\n\nWe had a similar issue in glance client. Take a look: https://review.openstack.org/#/c/527370/3","commit_id":"3a365596c208f9cda435c675c5d1006bdd81bcb1"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"62ad7307de7495b6120daaea311172c60a29fc8a","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        image_chunks \u003d self.call(method, image_id)"},{"line_number":220,"context_line":"        # NOTE(dtantsur): image_chunks is actually a wrapper around real data,"},{"line_number":221,"context_line":"        # so we have to check the wrapped data for None."},{"line_number":222,"context_line":"        if image_chunks.wrapped is None:"},{"line_number":223,"context_line":"            raise exception.ImageDownloadFailed("},{"line_number":224,"context_line":"                image_href\u003dimage_href, reason\u003d_(\u0027image contains no data.\u0027))"},{"line_number":225,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f91af0f_83ad9eea","line":222,"updated":"2018-01-06 18:56:01.000000000","message":"I just noticed that this will fail in v1, because v1 returns an object, that doesn\u0027t contain \u0027wrapped\u0027 property:\nhttps://github.com/openstack/python-glanceclient/blob/master/glanceclient/common/utils.py#L459-L478\nv2 returns: https://github.com/openstack/python-glanceclient/blob/master/glanceclient/common/utils.py#L481-L502\nIt means that you need a version check, like on the line 208\n\u0027if self.version \u003d\u003d 2 and image_chunks.wrapped is None:\u0027","commit_id":"f93dc24855f80bd0c657eafe0d71cbb2d613fb7f"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"e174c2007528227b445585519b86d115c68b934e","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        image_chunks \u003d self.call(method, image_id)"},{"line_number":220,"context_line":"        # NOTE(dtantsur): image_chunks is actually a wrapper around real data,"},{"line_number":221,"context_line":"        # so we have to check the wrapped data for None."},{"line_number":222,"context_line":"        if image_chunks.wrapped is None:"},{"line_number":223,"context_line":"            raise exception.ImageDownloadFailed("},{"line_number":224,"context_line":"                image_href\u003dimage_href, reason\u003d_(\u0027image contains no data.\u0027))"},{"line_number":225,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f91af0f_92ecd48f","line":222,"in_reply_to":"9f91af0f_83ad9eea","updated":"2018-01-09 14:27:37.000000000","message":"in fact we\u0027ve deprecated glance v1 support long ago, so may be it is a nice moment to remove it finally...","commit_id":"f93dc24855f80bd0c657eafe0d71cbb2d613fb7f"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9bb2cc28d1bc3e510dd83296ea714be303963abf","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        image_chunks \u003d self.call(method, image_id)"},{"line_number":220,"context_line":"        # NOTE(dtantsur): image_chunks is actually a wrapper around real data,"},{"line_number":221,"context_line":"        # so we have to check the wrapped data for None."},{"line_number":222,"context_line":"        if image_chunks.wrapped is None:"},{"line_number":223,"context_line":"            raise exception.ImageDownloadFailed("},{"line_number":224,"context_line":"                image_href\u003dimage_href, reason\u003d_(\u0027image contains no data.\u0027))"},{"line_number":225,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_cd91e054","line":222,"in_reply_to":"9f91af0f_92ecd48f","updated":"2018-01-12 10:44:55.000000000","message":"Ideally, we should backport this patch, so I\u0027d prefer to fix it first.","commit_id":"f93dc24855f80bd0c657eafe0d71cbb2d613fb7f"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"7897d5a2eeb927369a612b59d2eb2f2f9a79ab27","unresolved":false,"context_lines":[{"line_number":217,"context_line":"                return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        image_chunks \u003d self.call(method, image_id)"},{"line_number":220,"context_line":"        # NOTE(dtantsur): when using Glance V2, image_chunks is a wrapper"},{"line_number":221,"context_line":"        # around real data, so we have to check the wrapped data for None."},{"line_number":222,"context_line":"        # TODO(dtantsur): remove the hasattr check when we no longer support"},{"line_number":223,"context_line":"        # Glance V1."}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_689e7a64","line":220,"updated":"2018-02-06 22:26:57.000000000","message":"Is this change only mean to deal with Glance v2? or V2 \u0026 V1? Because this only looks like it is handling it for V2. And the commit msg doesn\u0027t say that it is fixing for V2 only.","commit_id":"8fb392d304ec61cfdd37e18a7a6d4212b2d6eea9"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"342e85ce088ea60962a96b457db1e79ec0a52fb6","unresolved":false,"context_lines":[{"line_number":217,"context_line":"                return"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        image_chunks \u003d self.call(method, image_id)"},{"line_number":220,"context_line":"        # NOTE(dtantsur): when using Glance V2, image_chunks is a wrapper"},{"line_number":221,"context_line":"        # around real data, so we have to check the wrapped data for None."},{"line_number":222,"context_line":"        # TODO(dtantsur): remove the hasattr check when we no longer support"},{"line_number":223,"context_line":"        # Glance V1."}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa0c359_1b44d4b6","line":220,"in_reply_to":"3fa0c359_689e7a64","updated":"2018-02-07 07:50:00.000000000","message":"IIUC glance v1 does not return empty data, so the fix is only required for glance v2. Mike will correct me if I\u0027m wrong :)","commit_id":"8fb392d304ec61cfdd37e18a7a6d4212b2d6eea9"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"094d111714d96305b474cf0d88b142e312d25284","unresolved":false,"context_lines":[{"line_number":221,"context_line":"        # around real data, so we have to check the wrapped data for None."},{"line_number":222,"context_line":"        # TODO(dtantsur): remove the hasattr check when we no longer support"},{"line_number":223,"context_line":"        # Glance V1."},{"line_number":224,"context_line":"        if hasattr(image_chunks, \u0027wrapped\u0027) and image_chunks.wrapped is None:"},{"line_number":225,"context_line":"            raise exception.ImageDownloadFailed("},{"line_number":226,"context_line":"                image_href\u003dimage_href, reason\u003d_(\u0027image contains no data.\u0027))"},{"line_number":227,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_2162cb3f","line":224,"updated":"2018-01-12 13:40:29.000000000","message":"tbh, it is antipattern to use hasattr on class properties, but I think it is okay in this case.","commit_id":"8fb392d304ec61cfdd37e18a7a6d4212b2d6eea9"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d8c180d0ed60a769bd0745f913a73e63c65b1c4e","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        # Glance V1 returns HTTP 404 in this case, so no need to fix it."},{"line_number":223,"context_line":"        # TODO(dtantsur): remove the hasattr check when we no longer support"},{"line_number":224,"context_line":"        # Glance V1."},{"line_number":225,"context_line":"        if hasattr(image_chunks, \u0027wrapped\u0027) and image_chunks.wrapped is None:"},{"line_number":226,"context_line":"            raise exception.ImageDownloadFailed("},{"line_number":227,"context_line":"                image_href\u003dimage_href, reason\u003d_(\u0027image contains no data.\u0027))"},{"line_number":228,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa0c359_5a624b40","line":225,"updated":"2018-02-07 15:09:43.000000000","message":"You could have also checked for self.version \u003d\u003d2 instead of this hasattr(), right?","commit_id":"70039cbe607195f66872d8640976c13284f75b79"}],"ironic/tests/unit/common/test_glance_service.py":[{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"62ad7307de7495b6120daaea311172c60a29fc8a","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        self.assertTrue(mock_sleep.called)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    @mock.patch.object(time, \u0027sleep\u0027, autospec\u003dTrue)"},{"line_number":207,"context_line":"    def test_download_no_data(self, mock_sleep):"},{"line_number":208,"context_line":"        self.client.fake_wrapped \u003d None"},{"line_number":209,"context_line":"        image_id \u003d uuidutils.generate_uuid()"},{"line_number":210,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f91af0f_c3f5e6ee","line":207,"updated":"2018-01-06 18:56:01.000000000","message":"Probably you should rewrite this test, because you test it against v1.\nv1 is not affected by the bug and returns 404 if in cannot find image data. v2 returns 204 which is transformed to None by the client. Just compare:\nv1: https://github.com/openstack/glance/blob/master/glance/api/v1/images.py#L515\nv2: https://github.com/openstack/glance/blob/master/glance/api/v2/image_data.py#L464 \n\nI think re-declaring self.service at the beginning should be enough:\n\u0027self.service \u003d service.GlanceImageService(self.client, 2, self.context)\u0027","commit_id":"f93dc24855f80bd0c657eafe0d71cbb2d613fb7f"}],"releasenotes/notes/image-no-data-c281f638d3dedfb2.yaml":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"7897d5a2eeb927369a612b59d2eb2f2f9a79ab27","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Returns correct error message when any of the glance images contains no"},{"line_number":5,"context_line":"    actual data. Previously it would end up in a Python ``TypeError``."}],"source_content_type":"text/x-yaml","patch_set":3,"id":"3fa0c359_c8f6ae90","line":4,"updated":"2018-02-06 22:26:57.000000000","message":"s/glance/Image service/\n\nMaybe\n\nReturns an ImageDownloadFailed exception with an appropriate message if an image from the Image service doesn\u0027t contain any data. Previously it was returning a Python ``TypeError``.\n\nI suppose you could add a link to the bug.","commit_id":"8fb392d304ec61cfdd37e18a7a6d4212b2d6eea9"}]}
