)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8027,"name":"Vui Lam","email":"vui@vmware.com","username":"vui"},"change_message_id":"837100bda356ffd8adbd7d869d4598400ee9b721","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Maithem \u003cmunshedm@vmware.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-11-11 16:08:13 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Closes-Bug: 1247296"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I71cfa8d4d1eb7911abb489153292fb0d1e614765"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAATn%2F%2FRQA%3D","line":7,"updated":"2013-11-12 00:31:13.000000000","message":"Hi Maithem, not sure if this is still in draft mode or not, but when ready, the commit message will have to be fleshed out a bit. Please see: https://wiki.openstack.org/wiki/GitCommitMessages for guidelines","commit_id":"4ae99f4c0b0dab94bd2f917a800fc09f1749df03"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e557c99f36ac9ba36cf9d2e30bb9132b3c44bbd7","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Maithem \u003cmunshedm@vmware.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-11-12 15:58:36 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Always upload a snapshot as a preallocated disk"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently, a snapshot operation always produces a preallocated"},{"line_number":10,"context_line":"disk type. When the snapshot is uploaded to glance, the source"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAATn%2F%2FJ3U%3D","line":7,"updated":"2013-11-13 16:58:10.000000000","message":"please add prefix vmware","commit_id":"31755a67d506dbfb87947e48099dd468166f478c"}],"nova/tests/virt/vmwareapi/test_vmwareapi.py":[{"author":{"_account_id":8027,"name":"Vui Lam","email":"vui@vmware.com","username":"vui"},"change_message_id":"10ef9b1a338efb05c3512830e091e90e6de633d3","unresolved":false,"context_lines":[{"line_number":391,"context_line":"                        network_info\u003dself.network_info,"},{"line_number":392,"context_line":"                        block_device_info\u003dblock_device_info)"},{"line_number":393,"context_line":""},{"line_number":394,"context_line":"    def _validate_metadata(self, context, image_id, instance, os_type,"},{"line_number":395,"context_line":"                           disk_type, adapter_type, image_version, host,"},{"line_number":396,"context_line":"                           data_center_name, datastore_name, cookies,"},{"line_number":397,"context_line":"                           file_path):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2B%2Bdw%3D","line":394,"updated":"2013-11-17 08:41:57.000000000","message":"mock noob here, so take with grain of salt:\n\nNit: perhaps calling the method _mock_upload_images makes more sense.\n\nNit: if we do rename the method, it doesn\u0027t hurt to simplify the signature to match upload_images, like so:\n\n   def _mock_upload_images(self, context, image_id, instance, **kwargs):\n      self.assertEqual(kwargs[\u0027disk_type\u0027], \u0027preallocated\u0027)","commit_id":"8e5c3d43739cd4cd9d349e47191ee818896f2b2c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"ffa9efc7e0c10deefe8b380d21cc1310d4ddfbac","unresolved":false,"context_lines":[{"line_number":412,"context_line":"                                   \u0027node\u0027: self.instance_node})"},{"line_number":413,"context_line":"        self._check_vm_info(info, power_state.RUNNING)"},{"line_number":414,"context_line":"        with mock.patch.object(vmware_images, \u0027upload_image\u0027,"},{"line_number":415,"context_line":"                               self._validate_metadata):"},{"line_number":416,"context_line":"            self.conn.snapshot(self.context, self.instance, \"Test-Snapshot\","},{"line_number":417,"context_line":"                               func_call_matcher.call)"},{"line_number":418,"context_line":"        info \u003d self.conn.get_info({\u0027uuid\u0027: self.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2B6T4%3D","line":415,"updated":"2013-11-18 17:09:10.000000000","message":"I would use:\n\n    with mock.patch.object(vmware_images, \u0027upload_image\u0027) as mock_upload_image:\n        self.conn.snapshot(self.context, self.instance, \"Test-Snapshot\",\n                           func_call_matcher.call)\n        mock_upload_image.assert_called_once_with(\n            mock.ANY, mock.ANY, mock.ANY,\n            os_type\u003dmock.ANY, disk_type\u003d\u0027preallocated\u0027, adapter_type\u003dmock.ANY,\n            …)\n\n(Actually, I\u0027d tend to fill in the expected values rather than using mock.ANY.  Also note the calling conventions on the parameters—some are passed as positional, others are passed as keyword parameters.)","commit_id":"8e5c3d43739cd4cd9d349e47191ee818896f2b2c"},{"author":{"_account_id":9046,"name":"Maithem","email":"munshedm@vmware.com","username":"Maithem"},"change_message_id":"f8e78dfa1f50883a83558d316d95f879b11a80dc","unresolved":false,"context_lines":[{"line_number":412,"context_line":"                                   \u0027node\u0027: self.instance_node})"},{"line_number":413,"context_line":"        self._check_vm_info(info, power_state.RUNNING)"},{"line_number":414,"context_line":"        with mock.patch.object(vmware_images, \u0027upload_image\u0027,"},{"line_number":415,"context_line":"                               self._validate_metadata):"},{"line_number":416,"context_line":"            self.conn.snapshot(self.context, self.instance, \"Test-Snapshot\","},{"line_number":417,"context_line":"                               func_call_matcher.call)"},{"line_number":418,"context_line":"        info \u003d self.conn.get_info({\u0027uuid\u0027: self.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2B5UA%3D","line":415,"in_reply_to":"AAAATn%2F%2B514%3D","updated":"2013-11-18 21:45:44.000000000","message":"Despite the fact that the disk_type is fixed regardless of the input, the test assures that any future transformations of the image metadata wouldn\u0027t result in a disk_type that isn\u0027t preallocated.","commit_id":"8e5c3d43739cd4cd9d349e47191ee818896f2b2c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"9531c1ea6335d4b175eb1d030b08e7c691211c2f","unresolved":false,"context_lines":[{"line_number":412,"context_line":"                                   \u0027node\u0027: self.instance_node})"},{"line_number":413,"context_line":"        self._check_vm_info(info, power_state.RUNNING)"},{"line_number":414,"context_line":"        with mock.patch.object(vmware_images, \u0027upload_image\u0027,"},{"line_number":415,"context_line":"                               self._validate_metadata):"},{"line_number":416,"context_line":"            self.conn.snapshot(self.context, self.instance, \"Test-Snapshot\","},{"line_number":417,"context_line":"                               func_call_matcher.call)"},{"line_number":418,"context_line":"        info \u003d self.conn.get_info({\u0027uuid\u0027: self.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2B5DI%3D","line":415,"in_reply_to":"AAAATn%2F%2B5No%3D","updated":"2013-11-18 22:09:22.000000000","message":"It\u0027s just my preference.  Because it is a preference, I didn\u0027t factor it into my review vote; if you want to leave it as is, that\u0027s fine too.","commit_id":"8e5c3d43739cd4cd9d349e47191ee818896f2b2c"},{"author":{"_account_id":642,"name":"Matt Dietz","email":"matthew.dietz@gmail.com","username":"cerberus"},"change_message_id":"9fbd688114eeb03b8cdfe526a993d47965c58995","unresolved":false,"context_lines":[{"line_number":412,"context_line":"                                   \u0027node\u0027: self.instance_node})"},{"line_number":413,"context_line":"        self._check_vm_info(info, power_state.RUNNING)"},{"line_number":414,"context_line":"        with mock.patch.object(vmware_images, \u0027upload_image\u0027,"},{"line_number":415,"context_line":"                               self._validate_metadata):"},{"line_number":416,"context_line":"            self.conn.snapshot(self.context, self.instance, \"Test-Snapshot\","},{"line_number":417,"context_line":"                               func_call_matcher.call)"},{"line_number":418,"context_line":"        info \u003d self.conn.get_info({\u0027uuid\u0027: self.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2B514%3D","line":415,"in_reply_to":"AAAATn%2F%2B6T4%3D","updated":"2013-11-18 18:59:28.000000000","message":"I generally advise *not* relying mocked calls as a testable pattern because they\u0027re so fragile. However, that this doesn\u0027t return anything implies that this the only way to test it explicitly. The problem here, of course, is that the test contrives the expected result and then asks for it, so it\u0027s likely to succeed regardless of the implementation.","commit_id":"8e5c3d43739cd4cd9d349e47191ee818896f2b2c"},{"author":{"_account_id":9046,"name":"Maithem","email":"munshedm@vmware.com","username":"Maithem"},"change_message_id":"f8e78dfa1f50883a83558d316d95f879b11a80dc","unresolved":false,"context_lines":[{"line_number":412,"context_line":"                                   \u0027node\u0027: self.instance_node})"},{"line_number":413,"context_line":"        self._check_vm_info(info, power_state.RUNNING)"},{"line_number":414,"context_line":"        with mock.patch.object(vmware_images, \u0027upload_image\u0027,"},{"line_number":415,"context_line":"                               self._validate_metadata):"},{"line_number":416,"context_line":"            self.conn.snapshot(self.context, self.instance, \"Test-Snapshot\","},{"line_number":417,"context_line":"                               func_call_matcher.call)"},{"line_number":418,"context_line":"        info \u003d self.conn.get_info({\u0027uuid\u0027: self.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2B5No%3D","line":415,"in_reply_to":"AAAATn%2F%2B6T4%3D","updated":"2013-11-18 21:45:44.000000000","message":"I have seen both ways used in xenapi and libvirt test cases. Is it a matter of preference/style, or are there advantages to the why you have suggested(other than checking other expected parameters)?","commit_id":"8e5c3d43739cd4cd9d349e47191ee818896f2b2c"}],"nova/virt/vmwareapi/fake.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"1ba08d4a44d57f472e2c2420c95c4ff393dc053b","unresolved":false,"context_lines":[{"line_number":798,"context_line":"def fake_upload_image(context, image, instance, **kwargs):"},{"line_number":799,"context_line":"    \"\"\"Fakes the upload of an image.\"\"\""},{"line_number":800,"context_line":"    disk_type \u003d kwargs.get(\"disk_type\")"},{"line_number":801,"context_line":"    assert disk_type \u003d\u003d \"preallocated\""},{"line_number":802,"context_line":""},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"def fake_get_vmdk_size_and_properties(context, image_id, instance):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FJ7I%3D","line":801,"updated":"2013-11-13 16:44:18.000000000","message":"We have discouraged using assert in the past.  You may want to consider using a mock to ensure that disk_type is set to \"preallocated\"…","commit_id":"31755a67d506dbfb87947e48099dd468166f478c"}],"nova/virt/vmwareapi/vmware_images.py":[{"author":{"_account_id":7040,"name":"GuoHui LIu","email":"liuguohui@gmail.com","username":"guohliu"},"change_message_id":"cfadca4fba05448fe56182c3cd2f810046a60b6c","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                      \"size\": file_size,"},{"line_number":161,"context_line":"                      \"properties\": {\"vmware_adaptertype\":"},{"line_number":162,"context_line":"                                            kwargs.get(\"adapter_type\"),"},{"line_number":163,"context_line":"                                     \"vmware_disktype\" : kwargs.get(\"disk_type\"),"},{"line_number":164,"context_line":"                                     \"vmware_ostype\": kwargs.get(\"os_type\"),"},{"line_number":165,"context_line":"                                     \"vmware_image_version\":"},{"line_number":166,"context_line":"                                            kwargs.get(\"image_version\"),"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2FRJw%3D","line":163,"updated":"2013-11-12 01:02:20.000000000","message":"For the most part we try to follow PEP 8 guidelines which can be viewed here: http://www.python.org/dev/peps/pep-0008/","commit_id":"4ae99f4c0b0dab94bd2f917a800fc09f1749df03"}]}
