)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0262398abff0dfd67d85f6886531485aa5011ddf","unresolved":false,"context_lines":[{"line_number":22,"context_line":"actually, `40` is volume size, not voluem id."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"This could be a little misleading."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: If5b0c2f28773e0b2fcb008d5251fb69d950ca569"},{"line_number":27,"context_line":"Signed-off-by: Fan Zhang \u003czh.f@outlook.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3fa7e38b_9926c068","line":25,"updated":"2019-10-03 17:09:10.000000000","message":"Oh we should have a bug for this so we can backport it.","commit_id":"7362fca8f5769ebed55ecdc07a38d4f515ab3dca"}],"nova/tests/unit/volume/test_cinder.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57bb3ae7b7d05514dd15df41cc90a45bddebac39","unresolved":false,"context_lines":[{"line_number":1009,"context_line":"        self._do_translate_exception_test(raised_exc, expected_exc,"},{"line_number":1010,"context_line":"                                          cinder.translate_mixed_exceptions)"},{"line_number":1011,"context_line":""},{"line_number":1012,"context_line":"    def _do_translate_create_exception_test(self, raised_exc, expected_exc):"},{"line_number":1013,"context_line":"        self._do_translate_exception_test(raised_exc, expected_exc,"},{"line_number":1014,"context_line":"                                          cinder.translate_create_exception)"},{"line_number":1015,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_0719a986","line":1012,"updated":"2019-08-30 14:36:45.000000000","message":"This just tests the decorator, not that the create() method is actually using that decorator. A useful test to me would be recreating the example from the commit message where you\u0027re calling create with a given size and volume_id and assert that the resulting error has the volume_id rather than the size in the translated error.","commit_id":"0b18781425cbf8507c9d7a023cf422438689188d"},{"author":{"_account_id":25113,"name":"Fan Zhang","email":"zh.f@outlook.com","username":"fanzhang"},"change_message_id":"87d088f01f327686db37855cae2593e8ff6856c2","unresolved":false,"context_lines":[{"line_number":1009,"context_line":"        self._do_translate_exception_test(raised_exc, expected_exc,"},{"line_number":1010,"context_line":"                                          cinder.translate_mixed_exceptions)"},{"line_number":1011,"context_line":""},{"line_number":1012,"context_line":"    def _do_translate_create_exception_test(self, raised_exc, expected_exc):"},{"line_number":1013,"context_line":"        self._do_translate_exception_test(raised_exc, expected_exc,"},{"line_number":1014,"context_line":"                                          cinder.translate_create_exception)"},{"line_number":1015,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_0e521a13","line":1012,"in_reply_to":"7faddb67_0719a986","updated":"2019-08-31 02:05:29.000000000","message":"Thanks Matt, will add unit tests later.","commit_id":"0b18781425cbf8507c9d7a023cf422438689188d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bf636f95f7553fc2897882d4110c03a08cf291af","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        mock_cinderclient.return_value.volumes.create.side_effect \u003d ("},{"line_number":216,"context_line":"            cinder_exception.NotFound(404, \u0027Volume type can not be found.\u0027))"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        self.assertRaises(exception.NotFound,"},{"line_number":219,"context_line":"                          self.api.create, self.ctx, 1, \u0027\u0027, \u0027\u0027)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    @mock.patch(\u0027nova.volume.cinder.cinderclient\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_401d960d","line":218,"updated":"2019-09-19 15:27:31.000000000","message":"This is insufficient to ensure that the create method is decorated with translate_create_exception because I can revert your fix and this test still passes.\n\nYou should trap the exception returned from assertRaises and assert something about the error message that would only work if create is using translate_create_exception.\n\nThat\u0027s probably as simple as something like this:\n\nex \u003d self.assertRaises(exception.NotFound, ...)\nself.assertIn(\u0027Volume type can not be found\u0027, six.text_type(ex))\n\nWithout the fix, that will fail because the error message would be something like \"Volume 1 could not be found.\".","commit_id":"9c65f7c3978ccad95f56f5b7844e79bef564536f"},{"author":{"_account_id":25113,"name":"Fan Zhang","email":"zh.f@outlook.com","username":"fanzhang"},"change_message_id":"6e691b870a5370a64080cbbb39843ae89bae5e90","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        mock_cinderclient.return_value.volumes.create.side_effect \u003d ("},{"line_number":216,"context_line":"            cinder_exception.NotFound(404, \u0027Volume type can not be found.\u0027))"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        self.assertRaises(exception.NotFound,"},{"line_number":219,"context_line":"                          self.api.create, self.ctx, 1, \u0027\u0027, \u0027\u0027)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    @mock.patch(\u0027nova.volume.cinder.cinderclient\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_1c06fecf","line":218,"in_reply_to":"3fa7e38b_401d960d","updated":"2019-09-23 02:48:30.000000000","message":"Thanks for detail explanation. Done.","commit_id":"9c65f7c3978ccad95f56f5b7844e79bef564536f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b11586b24704a7f1ee14178f78ac7a6715c3032a","unresolved":false,"context_lines":[{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        ex \u003d self.assertRaises(exception.NotFound,"},{"line_number":219,"context_line":"                               self.api.create, self.ctx, 1, \u0027\u0027, \u0027\u0027)"},{"line_number":220,"context_line":"        self.assertEqual(\u0027Volume type can not be found.\u0027, six.text_type(ex))"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    @mock.patch(\u0027nova.volume.cinder.cinderclient\u0027)"},{"line_number":223,"context_line":"    def test_create_over_quota_failed(self, mock_cinderclient):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_d92c384c","line":220,"updated":"2019-10-03 17:08:44.000000000","message":"This is better, thanks. I pulled down the patch and removed the fix and this fails as expected:\n\nnova.tests.unit.volume.test_cinder.CinderApiTestCase.test_create_failed_not_found\n---------------------------------------------------------------------------------\n\nCaptured traceback:\n~~~~~~~~~~~~~~~~~~~\n    b\u0027Traceback (most recent call last):\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/py36/lib/python3.6/site-packages/mock/mock.py\", line 1330, in patched\u0027\n    b\u0027    return func(*args, **keywargs)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/nova/tests/unit/volume/test_cinder.py\", line 220, in test_create_failed_not_found\u0027\n    b\"    self.assertEqual(\u0027Volume type can not be found.\u0027, six.text_type(ex))\"\n    b\u0027  File \"/home/osboxes/git/nova/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py\", line 411, in assertEqual\u0027\n    b\u0027    self.assertThat(observed, matcher, message)\u0027\n    b\u0027  File \"/home/osboxes/git/nova/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py\", line 498, in assertThat\u0027\n    b\u0027    raise mismatch_error\u0027\n    b\"testtools.matchers._impl.MismatchError: \u0027Volume type can not be found.\u0027 !\u003d \u0027Volume 1 could not be found.\u0027\"\n    b\u0027\u0027","commit_id":"7362fca8f5769ebed55ecdc07a38d4f515ab3dca"}],"nova/volume/cinder.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bf636f95f7553fc2897882d4110c03a08cf291af","unresolved":false,"context_lines":[{"line_number":419,"context_line":"            res \u003d method(self, ctx, size, *args, **kwargs)"},{"line_number":420,"context_line":"        except (keystone_exception.NotFound, cinder_exception.NotFound) as e:"},{"line_number":421,"context_line":"            _reraise(exception.NotFound(message\u003de.message))"},{"line_number":422,"context_line":"        except cinder_exception.OverLimit as e:"},{"line_number":423,"context_line":"            _reraise(exception.OverQuota(message\u003de.message))"},{"line_number":424,"context_line":"        return res"},{"line_number":425,"context_line":"    return translate_cinder_exception(wrapper)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_c063c6b0","line":422,"updated":"2019-09-19 15:27:31.000000000","message":"There is no test coverage for this.","commit_id":"9c65f7c3978ccad95f56f5b7844e79bef564536f"},{"author":{"_account_id":25113,"name":"Fan Zhang","email":"zh.f@outlook.com","username":"fanzhang"},"change_message_id":"6e691b870a5370a64080cbbb39843ae89bae5e90","unresolved":false,"context_lines":[{"line_number":419,"context_line":"            res \u003d method(self, ctx, size, *args, **kwargs)"},{"line_number":420,"context_line":"        except (keystone_exception.NotFound, cinder_exception.NotFound) as e:"},{"line_number":421,"context_line":"            _reraise(exception.NotFound(message\u003de.message))"},{"line_number":422,"context_line":"        except cinder_exception.OverLimit as e:"},{"line_number":423,"context_line":"            _reraise(exception.OverQuota(message\u003de.message))"},{"line_number":424,"context_line":"        return res"},{"line_number":425,"context_line":"    return translate_cinder_exception(wrapper)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_7c693289","line":422,"in_reply_to":"3fa7e38b_c063c6b0","updated":"2019-09-23 02:48:30.000000000","message":"The patch did not change OverLimit reraise behavior,  so I think it\u0027s been covered by [1].\n\n[1].https://review.opendev.org/#/c/678991/4/nova/tests/unit/volume/test_cinder.py@223","commit_id":"9c65f7c3978ccad95f56f5b7844e79bef564536f"}]}
