)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"fe169e068f574584a22fcd14ec49dae4e2bcf462","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Haomai Wang \u003chaomai@unitedstack.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-06-09 19:44:44 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fixes rdb backend image size"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The original fix for bug 1219658 introduced a factor of 1024 error"},{"line_number":10,"context_line":"in the resulting rbd image size."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"1ae5cdf2_eade253d","line":7,"updated":"2014-06-13 08:39:39.000000000","message":"Opps noticed typo s/rdb/rbd/","commit_id":"c29a5c7ba5ef98418584008b14de9d16a6567125"}],"nova/tests/virt/libvirt/test_imagebackend.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"08bacfe7b2d3090d5be0d95c6e86ae57d9f28dce","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        image \u003d self.image_class(self.INSTANCE, self.NAME)"},{"line_number":825,"context_line":"        image.rbd \u003d fake_rbd()"},{"line_number":826,"context_line":"        self.stubs.Set(image, \u0027_connect_to_rados\u0027, lambda p: (None, None))"},{"line_number":827,"context_line":"        self.stubs.Set(image, \u0027_disconnect_from_rados\u0027, lambda io, ctx: True)"},{"line_number":828,"context_line":"        vol \u003d imagebackend.RBDVolumeProxy(image, image.rbd_name)"},{"line_number":829,"context_line":"        def fake_resize(size):"},{"line_number":830,"context_line":"            self.assertEqual(self.SIZE, size)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7adec928_01048513","line":827,"updated":"2014-05-13 13:26:37.000000000","message":"Here and below, please use mock, not mox, for new unit tests. Should be as simple as changing the uses of self.stubs.Set() to instead using a contextlib.nested() context manager with three mock.patch.object() calls.","commit_id":"2b483520bcc82ebbcdbb97095f764428f7beb528"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"55e7b37932141dcae0a27a4b5be35dc055c9d901","unresolved":false,"context_lines":[{"line_number":809,"context_line":"        self.assertEqual(image.path, rbd_path)"},{"line_number":810,"context_line":""},{"line_number":811,"context_line":"    def test_resize(self):"},{"line_number":812,"context_line":"        class fake_rbd(object):"},{"line_number":813,"context_line":"            class Error(object):"},{"line_number":814,"context_line":"                pass"},{"line_number":815,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1ae5cdf2_ac079880","line":812,"updated":"2014-06-16 13:59:40.000000000","message":"You can use a Mock() here to do the job without the ugly inlined class definitions. See the spec argument to the mock class for an idea on how to accomplish this. http://www.voidspace.org.uk/python/mock/mock.html","commit_id":"1f1414776c73448f68e74f0bcb037329640e38a1"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"55e7b37932141dcae0a27a4b5be35dc055c9d901","unresolved":false,"context_lines":[{"line_number":831,"context_line":"            mock.patch.object(image, \"_connect_to_rados\","},{"line_number":832,"context_line":"                              lambda p: (None, None)),"},{"line_number":833,"context_line":"            mock.patch.object(image, \"_disconnect_from_rados\","},{"line_number":834,"context_line":"                              lambda io, ctx: True)):"},{"line_number":835,"context_line":"            image.rbd \u003d fake_rbd()"},{"line_number":836,"context_line":"            vol \u003d imagebackend.RBDVolumeProxy(image, image.rbd_name)"},{"line_number":837,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1ae5cdf2_6c711044","line":834,"updated":"2014-06-16 13:59:40.000000000","message":"These should be indented one level more - this is very difficult to read.","commit_id":"1f1414776c73448f68e74f0bcb037329640e38a1"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"55e7b37932141dcae0a27a4b5be35dc055c9d901","unresolved":false,"context_lines":[{"line_number":835,"context_line":"            image.rbd \u003d fake_rbd()"},{"line_number":836,"context_line":"            vol \u003d imagebackend.RBDVolumeProxy(image, image.rbd_name)"},{"line_number":837,"context_line":""},{"line_number":838,"context_line":"            with contextlib.nested("},{"line_number":839,"context_line":"                mock.patch.object(vol, \"resize\", fake_resize)):"},{"line_number":840,"context_line":"                image._resize(image.rbd_name, self.SIZE)"},{"line_number":841,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1ae5cdf2_2fbffafd","line":838,"updated":"2014-06-16 13:59:40.000000000","message":"If you just mock out the class constructor to return a Mock you can check wather the resize gets called on it with assert_called_once_with and avoid this nesting mess that is imho completely impossible to read.\n\nYou will have only one with statement, and then check all the mocks that you can pass as names bound to the with statement. See numerous examples of how it\u0027s node in the nova tests.","commit_id":"1f1414776c73448f68e74f0bcb037329640e38a1"}],"nova/virt/libvirt/imagebackend.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ccb0e76112acdd1ec3b82c114a890187e96fee5b","unresolved":false,"context_lines":[{"line_number":657,"context_line":""},{"line_number":658,"context_line":"    def _resize(self, volume_name, size):"},{"line_number":659,"context_line":"        with RBDVolumeProxy(self, volume_name) as vol:"},{"line_number":660,"context_line":"            vol.resize(int(size))"},{"line_number":661,"context_line":""},{"line_number":662,"context_line":"    def create_image(self, prepare_template, base, size, *args, **kwargs):"},{"line_number":663,"context_line":"        if self.rbd is None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7adec928_1bc1b42e","line":660,"updated":"2014-05-07 18:11:24.000000000","message":"Hmm, is there no unit test that needed to be changed to correspond to this? If not, perhaps you could add one to ensure we don\u0027t have a future regression?","commit_id":"84e8371170b23ed9503a62a2ef2608276b283447"}]}
