)]}'
{"nova/tests/unit/virt/vmwareapi/test_driver_api.py":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"da06281f914522d97f14899ceb4bae8ab1606dae","unresolved":false,"context_lines":[{"line_number":1757,"context_line":""},{"line_number":1758,"context_line":"        adapter_type \u003d constants.DEFAULT_ADAPTER_TYPE"},{"line_number":1759,"context_line":"        disk_type \u003d constants.DEFAULT_DISK_TYPE"},{"line_number":1760,"context_line":"        vmdk_info \u003d vm_util.VmdkInfo(\u0027fake-path\u0027, adapter_type, disk_type, 64)"},{"line_number":1761,"context_line":"        with contextlib.nested("},{"line_number":1762,"context_line":"            mock.patch.object(vm_util, \u0027get_vm_ref\u0027,"},{"line_number":1763,"context_line":"                              return_value\u003dmock.sentinel.vm_ref),"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_cbd82321","line":1760,"updated":"2015-01-12 17:06:32.000000000","message":"what does 64 mean? can you define it as a constant instead, so it is clearer what you\u0027re trying to test?","commit_id":"3bba6ebea27bfc9d074808e8ab30ab20518526f6"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"12479018738861cbe87115ef6277693b19cbdee4","unresolved":false,"context_lines":[{"line_number":1757,"context_line":""},{"line_number":1758,"context_line":"        adapter_type \u003d constants.DEFAULT_ADAPTER_TYPE"},{"line_number":1759,"context_line":"        disk_type \u003d constants.DEFAULT_DISK_TYPE"},{"line_number":1760,"context_line":"        vmdk_info \u003d vm_util.VmdkInfo(\u0027fake-path\u0027, adapter_type, disk_type, 64)"},{"line_number":1761,"context_line":"        with contextlib.nested("},{"line_number":1762,"context_line":"            mock.patch.object(vm_util, \u0027get_vm_ref\u0027,"},{"line_number":1763,"context_line":"                              return_value\u003dmock.sentinel.vm_ref),"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_f3468dbf","line":1760,"in_reply_to":"3a961159_cbd82321","updated":"2015-01-15 11:34:12.000000000","message":"that is just the fake size of the disk","commit_id":"3bba6ebea27bfc9d074808e8ab30ab20518526f6"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"da06281f914522d97f14899ceb4bae8ab1606dae","unresolved":false,"context_lines":[{"line_number":1776,"context_line":"                                               self.instance)"},{"line_number":1777,"context_line":"            get_volume_ref.assert_called_once_with("},{"line_number":1778,"context_line":"                connection_info[\u0027data\u0027][\u0027volume\u0027])"},{"line_number":1779,"context_line":"            self.assertTrue(get_vmdk_info.called)"},{"line_number":1780,"context_line":"            attach_disk_to_vm.assert_called_once_with(mock.sentinel.vm_ref,"},{"line_number":1781,"context_line":"                self.instance, adapter_type, disk_type, vmdk_path\u003d\u0027fake-path\u0027)"},{"line_number":1782,"context_line":"            update_volume_details.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_4b0a737a","line":1779,"updated":"2015-01-12 17:06:32.000000000","message":"since you\u0027re changing this line, you could use instead get_vmdk_info.assert_called_once_with(...), so you can check that the methods are not just called, but called with the right arguments.","commit_id":"3bba6ebea27bfc9d074808e8ab30ab20518526f6"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"da06281f914522d97f14899ceb4bae8ab1606dae","unresolved":false,"context_lines":[{"line_number":1789,"context_line":""},{"line_number":1790,"context_line":"        adapter_type \u003d constants.DEFAULT_ADAPTER_TYPE"},{"line_number":1791,"context_line":"        disk_type \u003d constants.DEFAULT_DISK_TYPE"},{"line_number":1792,"context_line":"        vmdk_info \u003d vm_util.VmdkInfo(\u0027fake-path\u0027, adapter_type, disk_type, 64)"},{"line_number":1793,"context_line":"        with contextlib.nested("},{"line_number":1794,"context_line":"            mock.patch.object(vm_util, \u0027get_vm_ref\u0027,"},{"line_number":1795,"context_line":"                              return_value\u003dmock.sentinel.vm_ref),"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_6b01ef69","line":1792,"updated":"2015-01-12 17:06:32.000000000","message":"ditto.","commit_id":"3bba6ebea27bfc9d074808e8ab30ab20518526f6"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"12479018738861cbe87115ef6277693b19cbdee4","unresolved":false,"context_lines":[{"line_number":1789,"context_line":""},{"line_number":1790,"context_line":"        adapter_type \u003d constants.DEFAULT_ADAPTER_TYPE"},{"line_number":1791,"context_line":"        disk_type \u003d constants.DEFAULT_DISK_TYPE"},{"line_number":1792,"context_line":"        vmdk_info \u003d vm_util.VmdkInfo(\u0027fake-path\u0027, adapter_type, disk_type, 64)"},{"line_number":1793,"context_line":"        with contextlib.nested("},{"line_number":1794,"context_line":"            mock.patch.object(vm_util, \u0027get_vm_ref\u0027,"},{"line_number":1795,"context_line":"                              return_value\u003dmock.sentinel.vm_ref),"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_331015ab","line":1792,"in_reply_to":"3a961159_6b01ef69","updated":"2015-01-15 11:34:12.000000000","message":"ditto","commit_id":"3bba6ebea27bfc9d074808e8ab30ab20518526f6"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"da06281f914522d97f14899ceb4bae8ab1606dae","unresolved":false,"context_lines":[{"line_number":1815,"context_line":"                connection_info[\u0027data\u0027][\u0027volume\u0027])"},{"line_number":1816,"context_line":"            get_vmdk_backed_disk_device.assert_called_once_with("},{"line_number":1817,"context_line":"                mock.sentinel.vm_ref, connection_info[\u0027data\u0027])"},{"line_number":1818,"context_line":"            self.assertTrue(get_vmdk_info.called)"},{"line_number":1819,"context_line":"            consolidate_vmdk_volume.assert_called_once_with(self.instance,"},{"line_number":1820,"context_line":"                mock.sentinel.vm_ref, mock.sentinel.disk_device,"},{"line_number":1821,"context_line":"                mock.sentinel.volume_ref, adapter_type\u003dadapter_type,"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a961159_6b0f2f89","line":1818,"updated":"2015-01-12 17:06:32.000000000","message":"since you\u0027re changing this line, you could use instead get_vmdk_info.assert_called_once_with(...), so you can check that the methods are not just called, but called with the right arguments.","commit_id":"3bba6ebea27bfc9d074808e8ab30ab20518526f6"}],"nova/tests/virt/vmwareapi/test_vm_util.py":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"b43371bfe08efcf940a61141876d1b4b6e946907","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        filename \u003d \u0027[test_datastore] test_file.vmdk\u0027"},{"line_number":314,"context_line":"        devices \u003d self._vmdk_path_and_adapter_type_devices(filename)"},{"line_number":315,"context_line":"        session \u003d fake.FakeSession()"},{"line_number":316,"context_line":"        with mock.patch.object(session, \u0027_call_method\u0027, return_value\u003ddevices):"},{"line_number":317,"context_line":"            vmdk \u003d vm_util.get_vmdk_info(session, None)"},{"line_number":318,"context_line":"            self.assertEqual(\u0027lsiLogicsas\u0027, vmdk.adapter_type)"},{"line_number":319,"context_line":"            self.assertEqual(filename, vmdk.path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_d784e75f","line":316,"updated":"2014-10-23 15:55:55.000000000","message":"All Vim calls return devices!\n\nAs it happens I just added this to fake: https://review.openstack.org/#/c/130562/\nIf you want an example of how to use it, see here: https://review.openstack.org/#/c/130563/ . It\u0027s trivial.\n\nYou could create a new VM with your device list, then call vm_util.get_vmdk_info() on it, which would test the whole function.","commit_id":"3592e9d034d72446f8ee6a08d959b9c694840e00"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"95a258edc1946b1054791d0a734d2c3a5c7e44e3","unresolved":false,"context_lines":[{"line_number":313,"context_line":"        filename \u003d \u0027[test_datastore] test_file.vmdk\u0027"},{"line_number":314,"context_line":"        devices \u003d self._vmdk_path_and_adapter_type_devices(filename)"},{"line_number":315,"context_line":"        session \u003d fake.FakeSession()"},{"line_number":316,"context_line":"        with mock.patch.object(session, \u0027_call_method\u0027, return_value\u003ddevices):"},{"line_number":317,"context_line":"            vmdk \u003d vm_util.get_vmdk_info(session, None)"},{"line_number":318,"context_line":"            self.assertEqual(\u0027lsiLogicsas\u0027, vmdk.adapter_type)"},{"line_number":319,"context_line":"            self.assertEqual(filename, vmdk.path)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_aa0c433c","line":316,"in_reply_to":"9aa7fdbe_d784e75f","updated":"2014-10-24 13:10:54.000000000","message":"I agree that this can be written much better with fake and I will be happy to rewrite it when your patch gets in.","commit_id":"3592e9d034d72446f8ee6a08d959b9c694840e00"}],"nova/tests/virt/vmwareapi/test_vmops.py":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"b43371bfe08efcf940a61141876d1b4b6e946907","unresolved":false,"context_lines":[{"line_number":386,"context_line":"            self.assertEqual(\u0027get_dynamic_property\u0027, method)"},{"line_number":387,"context_line":"            self.assertEqual(expected_args, args)"},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"        vmdk \u003d mock.Mock()"},{"line_number":390,"context_line":"        with contextlib.nested("},{"line_number":391,"context_line":"                mock.patch.object(vm_util, \u0027get_vmdk_info\u0027,"},{"line_number":392,"context_line":"                                  return_value\u003dvmdk),"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_5cd3bc03","line":389,"updated":"2014-10-23 15:55:55.000000000","message":"This is a kinda tricky use of Mock. Having read it a few times I think it\u0027s probably correct, but it\u0027s not very clear. What you\u0027re actually testing below is that the path passed to get_vmdk_volume_disk below is the one which was returned by get_vmdk_info. I believe this code achieves this because:\n\nunrescue calls vmdk.path when constructing arguments to get_vmdk_volume_disk, which creates a new mock.\nThe test below retrieves the same mock, because it has was created when unrescue called it.\nThe 2 obviously match.\n\nI think this would be both a better test and easier to read if you did:\n\nvmdk \u003d VmdkInfo(mock.sentinel.PATH, mock.sentinel.ADAPTER_TYPE, ...)\n\n\u003csnip\u003e\n\n_get_vmdk_volume_disk(None, path\u003dmock.sentinel.PATH)","commit_id":"3592e9d034d72446f8ee6a08d959b9c694840e00"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"95a258edc1946b1054791d0a734d2c3a5c7e44e3","unresolved":false,"context_lines":[{"line_number":386,"context_line":"            self.assertEqual(\u0027get_dynamic_property\u0027, method)"},{"line_number":387,"context_line":"            self.assertEqual(expected_args, args)"},{"line_number":388,"context_line":""},{"line_number":389,"context_line":"        vmdk \u003d mock.Mock()"},{"line_number":390,"context_line":"        with contextlib.nested("},{"line_number":391,"context_line":"                mock.patch.object(vm_util, \u0027get_vmdk_info\u0027,"},{"line_number":392,"context_line":"                                  return_value\u003dvmdk),"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_0a1b8f73","line":389,"in_reply_to":"9aa7fdbe_5cd3bc03","updated":"2014-10-24 13:10:54.000000000","message":"Done","commit_id":"3592e9d034d72446f8ee6a08d959b9c694840e00"}],"nova/virt/vmwareapi/vm_util.py":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"b43371bfe08efcf940a61141876d1b4b6e946907","unresolved":false,"context_lines":[{"line_number":443,"context_line":"                    if getattr(device.backing, \u0027eagerlyScrub\u0027, False):"},{"line_number":444,"context_line":"                        disk_type \u003d \"eagerZeroedThick\""},{"line_number":445,"context_line":"                    else:"},{"line_number":446,"context_line":"                        disk_type \u003d constants.DEFAULT_DISK_TYPE"},{"line_number":447,"context_line":"        elif device.__class__.__name__ \u003d\u003d \"VirtualLsiLogicController\":"},{"line_number":448,"context_line":"            adapter_type_dict[device.key] \u003d constants.DEFAULT_ADAPTER_TYPE"},{"line_number":449,"context_line":"        elif device.__class__.__name__ \u003d\u003d \"VirtualBusLogicController\":"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_77d09bf6","line":446,"updated":"2014-10-23 15:55:55.000000000","message":"Wouldn\u0027t you want to break here? This function is returning info about the last disk, whereas the first disk is what is intended where it\u0027s used.\n\nIn fact, what does this function mean? If you audit all its uses, I\u0027ll bet anything which uses the returned path is broken in the presence of multiple disks.","commit_id":"3592e9d034d72446f8ee6a08d959b9c694840e00"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"95a258edc1946b1054791d0a734d2c3a5c7e44e3","unresolved":false,"context_lines":[{"line_number":443,"context_line":"                    if getattr(device.backing, \u0027eagerlyScrub\u0027, False):"},{"line_number":444,"context_line":"                        disk_type \u003d \"eagerZeroedThick\""},{"line_number":445,"context_line":"                    else:"},{"line_number":446,"context_line":"                        disk_type \u003d constants.DEFAULT_DISK_TYPE"},{"line_number":447,"context_line":"        elif device.__class__.__name__ \u003d\u003d \"VirtualLsiLogicController\":"},{"line_number":448,"context_line":"            adapter_type_dict[device.key] \u003d constants.DEFAULT_ADAPTER_TYPE"},{"line_number":449,"context_line":"        elif device.__class__.__name__ \u003d\u003d \"VirtualBusLogicController\":"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa7fdbe_ea3f2bb2","line":446,"in_reply_to":"9aa7fdbe_77d09bf6","updated":"2014-10-24 13:10:54.000000000","message":"This function is supposed to return the primary VMDK from which the VM boots or the VMDK with the specified uuid if present.\n\nThere was some reason why we want the last disk but I don\u0027t remember it. I will sync with Gary and update appropriately.","commit_id":"3592e9d034d72446f8ee6a08d959b9c694840e00"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"2f9ff26a470e46fcc1356523e1181de2ef4918f9","unresolved":false,"context_lines":[{"line_number":499,"context_line":"            adapter_type_dict[device.key] \u003d constants.ADAPTER_TYPE_PARAVIRTUAL"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"    adapter_type \u003d adapter_type_dict.get(vmdk_controller_key, \"\")"},{"line_number":502,"context_line":"    return VmdkInfo(vmdk_file_path, adapter_type, disk_type, capacity)"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"def _find_controller_slot(controller_keys, taken, max_unit_number):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_f346a220","line":502,"updated":"2014-12-09 13:23:57.000000000","message":"Nice!","commit_id":"2ff9cc24ebd90c60e59f9db1d47bffb9bf6471d0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0f09f6d5768908bda2b2dd939b443d303ddc0a32","unresolved":false,"context_lines":[{"line_number":122,"context_line":"VNC_CONFIG_KEY \u003d \u0027config.extraConfig[\"RemoteDisplay.vnc.port\"]\u0027"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"VmdkInfo \u003d collections.namedtuple(\u0027VmdkInfo\u0027, [\u0027path\u0027, \u0027adapter_type\u0027,"},{"line_number":125,"context_line":"                                               \u0027disk_type\u0027, \u0027capacity\u0027])"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"def _iface_id_option_value(client_factory, iface_id, port_index):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_85b383eb","line":125,"updated":"2015-01-11 07:54:42.000000000","message":"please change this to capacity_bytes or something that indicates that this number is in bytes.","commit_id":"e23dc473607718db183981ecb00a6059cf047696"},{"author":{"_account_id":6983,"name":"YangLei","email":"iamhappg@aliyun.com","username":"YangLei"},"change_message_id":"b560b27b4e969a7ffa438979c9bd4be7d548fb47","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"def get_vmdk_info(session, vm_ref, uuid\u003dNone):"},{"line_number":452,"context_line":"    \"\"\"Returns information for the primary VMDK attached to the given VM.\"\"\""},{"line_number":453,"context_line":"    hardware_devices \u003d session._call_method(vim_util,"},{"line_number":454,"context_line":"            \"get_dynamic_property\", vm_ref, \"VirtualMachine\","},{"line_number":455,"context_line":"            \"config.hardware.device\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_0f588c56","line":452,"updated":"2015-01-12 03:41:26.000000000","message":"In fact, we just get the last vmdk here rather than primary vmdk. Please see the following comment. \nI think we can get all the vmdks in this function and \nmaybe we can add a parameter vmdk_idx\u003d0 to get the primary one by default.","commit_id":"e23dc473607718db183981ecb00a6059cf047696"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4486e729981be2c02bb9db7c0a21f2419971ec73","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"def get_vmdk_info(session, vm_ref, uuid\u003dNone):"},{"line_number":452,"context_line":"    \"\"\"Returns information for the primary VMDK attached to the given VM.\"\"\""},{"line_number":453,"context_line":"    hardware_devices \u003d session._call_method(vim_util,"},{"line_number":454,"context_line":"            \"get_dynamic_property\", vm_ref, \"VirtualMachine\","},{"line_number":455,"context_line":"            \"config.hardware.device\")"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_f746ab7a","line":452,"in_reply_to":"3a961159_0f588c56","updated":"2015-01-12 12:33:36.000000000","message":"the last vmdk is a problem - please see https://review.openstack.org/145744\nwe need the primary device - this is used for resuce, snapshot etc.","commit_id":"e23dc473607718db183981ecb00a6059cf047696"},{"author":{"_account_id":6983,"name":"YangLei","email":"iamhappg@aliyun.com","username":"YangLei"},"change_message_id":"b560b27b4e969a7ffa438979c9bd4be7d548fb47","unresolved":false,"context_lines":[{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    adapter_type_dict \u003d {}"},{"line_number":464,"context_line":"    for device in hardware_devices:"},{"line_number":465,"context_line":"        if device.__class__.__name__ \u003d\u003d \"VirtualDisk\":"},{"line_number":466,"context_line":"            if device.backing.__class__.__name__ \u003d\u003d \\"},{"line_number":467,"context_line":"                    \"VirtualDiskFlatVer2BackingInfo\":"},{"line_number":468,"context_line":"                if uuid:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_af413865","line":465,"updated":"2015-01-12 03:41:26.000000000","message":"If there are 2 or more VirtualDisk, We always get the last one. we need correct this behavior.\n\nAs i know, garyk is implementing \"vmware-ephemeral-disk-support\".\nthen instance will have 2 (or more) vmdks, but we just can get the last one rather than primary one here.","commit_id":"e23dc473607718db183981ecb00a6059cf047696"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4486e729981be2c02bb9db7c0a21f2419971ec73","unresolved":false,"context_lines":[{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    adapter_type_dict \u003d {}"},{"line_number":464,"context_line":"    for device in hardware_devices:"},{"line_number":465,"context_line":"        if device.__class__.__name__ \u003d\u003d \"VirtualDisk\":"},{"line_number":466,"context_line":"            if device.backing.__class__.__name__ \u003d\u003d \\"},{"line_number":467,"context_line":"                    \"VirtualDiskFlatVer2BackingInfo\":"},{"line_number":468,"context_line":"                if uuid:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a961159_7752bb36","line":465,"in_reply_to":"3a961159_af413865","updated":"2015-01-12 12:33:36.000000000","message":"last one is not correct - please see comment above","commit_id":"e23dc473607718db183981ecb00a6059cf047696"}]}
