)]}'
{"nova/tests/virt/vmwareapi/test_driver_api.py":[{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ec96ed8644ecdb444e7ecc2db03e69ecf3dfd8d5","unresolved":false,"context_lines":[{"line_number":2220,"context_line":"                                               ovs_interfaceid\u003d\u0027aaa-bbb-ccc\u0027)"},{"line_number":2221,"context_line":"        return vif_bridge_neutron"},{"line_number":2222,"context_line":""},{"line_number":2223,"context_line":"    def _validate_interface_update(self, id, index, num_iface_ids):"},{"line_number":2224,"context_line":"        vm_info \u003d self.conn.get_info({\u0027uuid\u0027: self.uuid,"},{"line_number":2225,"context_line":"                                      \u0027node\u0027: self.instance_node})"},{"line_number":2226,"context_line":"        vms \u003d vmwareapi_fake._get_objects(\"VirtualMachine\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"bad4c104_f42ee0a4","line":2223,"updated":"2014-04-29 07:32:25.000000000","message":"I suggest to rename this method to \"_validate_interfaces\"","commit_id":"eee6b6cf75bf6a3bcbef805a1803483e37a8aa79"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1323d2ea3ce34878c9f03fb5c1fab7de27e9cbae","unresolved":false,"context_lines":[{"line_number":2220,"context_line":"                                               ovs_interfaceid\u003d\u0027aaa-bbb-ccc\u0027)"},{"line_number":2221,"context_line":"        return vif_bridge_neutron"},{"line_number":2222,"context_line":""},{"line_number":2223,"context_line":"    def _validate_interface_update(self, id, index, num_iface_ids):"},{"line_number":2224,"context_line":"        vm_info \u003d self.conn.get_info({\u0027uuid\u0027: self.uuid,"},{"line_number":2225,"context_line":"                                      \u0027node\u0027: self.instance_node})"},{"line_number":2226,"context_line":"        vms \u003d vmwareapi_fake._get_objects(\"VirtualMachine\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"bad4c104_bb5d20ec","line":2223,"in_reply_to":"bad4c104_f42ee0a4","updated":"2014-04-29 12:58:52.000000000","message":"Done","commit_id":"eee6b6cf75bf6a3bcbef805a1803483e37a8aa79"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ec96ed8644ecdb444e7ecc2db03e69ecf3dfd8d5","unresolved":false,"context_lines":[{"line_number":2224,"context_line":"        vm_info \u003d self.conn.get_info({\u0027uuid\u0027: self.uuid,"},{"line_number":2225,"context_line":"                                      \u0027node\u0027: self.instance_node})"},{"line_number":2226,"context_line":"        vms \u003d vmwareapi_fake._get_objects(\"VirtualMachine\")"},{"line_number":2227,"context_line":"        vm \u003d vms.objects[0]"},{"line_number":2228,"context_line":""},{"line_number":2229,"context_line":"        found_iface_id \u003d False"},{"line_number":2230,"context_line":"        extras \u003d vm.get(\"config.extraConfig\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"bad4c104_34184884","line":2227,"updated":"2014-04-29 07:32:25.000000000","message":"this is a bit fragile; it\u0027d be nice if we can pass the VM as an argument","commit_id":"eee6b6cf75bf6a3bcbef805a1803483e37a8aa79"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1323d2ea3ce34878c9f03fb5c1fab7de27e9cbae","unresolved":false,"context_lines":[{"line_number":2224,"context_line":"        vm_info \u003d self.conn.get_info({\u0027uuid\u0027: self.uuid,"},{"line_number":2225,"context_line":"                                      \u0027node\u0027: self.instance_node})"},{"line_number":2226,"context_line":"        vms \u003d vmwareapi_fake._get_objects(\"VirtualMachine\")"},{"line_number":2227,"context_line":"        vm \u003d vms.objects[0]"},{"line_number":2228,"context_line":""},{"line_number":2229,"context_line":"        found_iface_id \u003d False"},{"line_number":2230,"context_line":"        extras \u003d vm.get(\"config.extraConfig\")"}],"source_content_type":"text/x-python","patch_set":29,"id":"bad4c104_5b2c144b","line":2227,"in_reply_to":"bad4c104_34184884","updated":"2014-04-29 12:58:52.000000000","message":"Done - please see https://review.openstack.org/#/c/91005/","commit_id":"eee6b6cf75bf6a3bcbef805a1803483e37a8aa79"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ec96ed8644ecdb444e7ecc2db03e69ecf3dfd8d5","unresolved":false,"context_lines":[{"line_number":2230,"context_line":"        extras \u003d vm.get(\"config.extraConfig\")"},{"line_number":2231,"context_line":"        key \u003d \"nvp.iface-id.%s\" % index"},{"line_number":2232,"context_line":"        num_found \u003d 0"},{"line_number":2233,"context_line":"        for c in extras.OptionValue:"},{"line_number":2234,"context_line":"            if c.key.startswith(\"nvp.iface-id.\"):"},{"line_number":2235,"context_line":"                num_found +\u003d 1"},{"line_number":2236,"context_line":"            if (c.key \u003d\u003d key and c.value \u003d\u003d id):"}],"source_content_type":"text/x-python","patch_set":29,"id":"bad4c104_6fa59d03","line":2233,"updated":"2014-04-29 07:32:25.000000000","message":"I see that you iterate extraConfig properties to parse NVP interfaces several times in this patch. I think it will make sense to have an NvpInterface structure and utility method that extracts NvpInterfaces from extraConfig. That will make the code more readable and we can get rid of the hardcoded strings that we have now.","commit_id":"eee6b6cf75bf6a3bcbef805a1803483e37a8aa79"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1323d2ea3ce34878c9f03fb5c1fab7de27e9cbae","unresolved":false,"context_lines":[{"line_number":2230,"context_line":"        extras \u003d vm.get(\"config.extraConfig\")"},{"line_number":2231,"context_line":"        key \u003d \"nvp.iface-id.%s\" % index"},{"line_number":2232,"context_line":"        num_found \u003d 0"},{"line_number":2233,"context_line":"        for c in extras.OptionValue:"},{"line_number":2234,"context_line":"            if c.key.startswith(\"nvp.iface-id.\"):"},{"line_number":2235,"context_line":"                num_found +\u003d 1"},{"line_number":2236,"context_line":"            if (c.key \u003d\u003d key and c.value \u003d\u003d id):"}],"source_content_type":"text/x-python","patch_set":29,"id":"bad4c104_76656d44","line":2233,"in_reply_to":"bad4c104_6fa59d03","updated":"2014-04-29 12:58:52.000000000","message":"I need to think about this a little.","commit_id":"eee6b6cf75bf6a3bcbef805a1803483e37a8aa79"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ec96ed8644ecdb444e7ecc2db03e69ecf3dfd8d5","unresolved":false,"context_lines":[{"line_number":2239,"context_line":"        self.assertEqual(num_found, num_iface_ids)"},{"line_number":2240,"context_line":""},{"line_number":2241,"context_line":"    def _attach_interface(self, vif):"},{"line_number":2242,"context_line":"        self._create_vm()"},{"line_number":2243,"context_line":"        self.conn.attach_interface(self.instance, self.image, vif)"},{"line_number":2244,"context_line":"        self._validate_interface_update(vif[\u0027id\u0027], 1, 2)"},{"line_number":2245,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bad4c104_6f7cbd73","line":2242,"updated":"2014-04-29 07:32:25.000000000","message":"nit: I am not sure this is the right place for create_vm, it looks like a dangerous side-effect to me","commit_id":"eee6b6cf75bf6a3bcbef805a1803483e37a8aa79"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1323d2ea3ce34878c9f03fb5c1fab7de27e9cbae","unresolved":false,"context_lines":[{"line_number":2239,"context_line":"        self.assertEqual(num_found, num_iface_ids)"},{"line_number":2240,"context_line":""},{"line_number":2241,"context_line":"    def _attach_interface(self, vif):"},{"line_number":2242,"context_line":"        self._create_vm()"},{"line_number":2243,"context_line":"        self.conn.attach_interface(self.instance, self.image, vif)"},{"line_number":2244,"context_line":"        self._validate_interface_update(vif[\u0027id\u0027], 1, 2)"},{"line_number":2245,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bad4c104_9b205c9d","line":2242,"in_reply_to":"bad4c104_6f7cbd73","updated":"2014-04-29 12:58:52.000000000","message":"Done","commit_id":"eee6b6cf75bf6a3bcbef805a1803483e37a8aa79"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ec96ed8644ecdb444e7ecc2db03e69ecf3dfd8d5","unresolved":false,"context_lines":[{"line_number":2267,"context_line":"    def _detach_interface(self, vif, mock_get_device):"},{"line_number":2268,"context_line":"        self._attach_interface(vif)"},{"line_number":2269,"context_line":"        self.conn.detach_interface(self.instance, vif)"},{"line_number":2270,"context_line":"        self._validate_interface_update(\u0027free\u0027, 1, 2)"},{"line_number":2271,"context_line":""},{"line_number":2272,"context_line":"    def test_detach_interface(self):"},{"line_number":2273,"context_line":"        vif \u003d self._create_vif()"}],"source_content_type":"text/x-python","patch_set":29,"id":"bad4c104_afc32589","line":2270,"updated":"2014-04-29 07:32:25.000000000","message":"you can avoid the magic strings if you go with the NvpInterface (see above)","commit_id":"eee6b6cf75bf6a3bcbef805a1803483e37a8aa79"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3113d56378a889dc77ce3a4702984d2cf90b8a48","unresolved":false,"context_lines":[{"line_number":2257,"context_line":""},{"line_number":2258,"context_line":"        with ("},{"line_number":2259,"context_line":"            mock.patch.object(self.conn._session, \u0027_wait_for_task\u0027,"},{"line_number":2260,"context_line":"                              fake_wait_for_task)"},{"line_number":2261,"context_line":"        ):"},{"line_number":2262,"context_line":"            self.assertRaises(exception.InterfaceAttachFailed,"},{"line_number":2263,"context_line":"                              self.conn.attach_interface,"}],"source_content_type":"text/x-python","patch_set":30,"id":"bad4c104_0ddb24ee","line":2260,"updated":"2014-04-29 20:35:41.000000000","message":"Just an FYI, you can remove the fake_wait_for_task definition and rewrite the above as just this:\n\n with mock.patch.object(self.conn._session, \u0027_wait_for_task\u0027,\n                        side_effect\u003dException):","commit_id":"5534dc75abdee5f8231e04a62e9227cf95061490"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1ae51f3cde41a3d1b6c4fae4db797fc32b47cbc4","unresolved":false,"context_lines":[{"line_number":2257,"context_line":""},{"line_number":2258,"context_line":"        with ("},{"line_number":2259,"context_line":"            mock.patch.object(self.conn._session, \u0027_wait_for_task\u0027,"},{"line_number":2260,"context_line":"                              fake_wait_for_task)"},{"line_number":2261,"context_line":"        ):"},{"line_number":2262,"context_line":"            self.assertRaises(exception.InterfaceAttachFailed,"},{"line_number":2263,"context_line":"                              self.conn.attach_interface,"}],"source_content_type":"text/x-python","patch_set":30,"id":"9ad9bd40_523795b0","line":2260,"in_reply_to":"bad4c104_0ddb24ee","updated":"2014-04-30 10:26:19.000000000","message":"Done","commit_id":"5534dc75abdee5f8231e04a62e9227cf95061490"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3113d56378a889dc77ce3a4702984d2cf90b8a48","unresolved":false,"context_lines":[{"line_number":2304,"context_line":"        self._attach_interface(vif)"},{"line_number":2305,"context_line":""},{"line_number":2306,"context_line":"        def fake_wait_for_task(instance_uuid, task_ref):"},{"line_number":2307,"context_line":"            raise Exception()"},{"line_number":2308,"context_line":""},{"line_number":2309,"context_line":"        with ("},{"line_number":2310,"context_line":"            mock.patch.object(self.conn._session, \u0027_wait_for_task\u0027,"}],"source_content_type":"text/x-python","patch_set":30,"id":"bad4c104_0d02443e","line":2307,"updated":"2014-04-29 20:35:41.000000000","message":"See comment above :)","commit_id":"5534dc75abdee5f8231e04a62e9227cf95061490"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":2250,"context_line":"        for c in extras.OptionValue:"},{"line_number":2251,"context_line":"            if c.key.startswith(\"nvp.iface-id.\"):"},{"line_number":2252,"context_line":"                num_found +\u003d 1"},{"line_number":2253,"context_line":"            if (c.key \u003d\u003d key and c.value \u003d\u003d id):"},{"line_number":2254,"context_line":"                found_iface_id \u003d True"},{"line_number":2255,"context_line":"        self.assertTrue(found_iface_id)"},{"line_number":2256,"context_line":"        self.assertEqual(num_found, num_iface_ids)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_3f607dce","line":2253,"updated":"2014-07-04 14:42:10.000000000","message":"nit: You could put this if inside the one above.\n\nDon\u0027t respin just for this.","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":2250,"context_line":"        for c in extras.OptionValue:"},{"line_number":2251,"context_line":"            if c.key.startswith(\"nvp.iface-id.\"):"},{"line_number":2252,"context_line":"                num_found +\u003d 1"},{"line_number":2253,"context_line":"            if (c.key \u003d\u003d key and c.value \u003d\u003d id):"},{"line_number":2254,"context_line":"                found_iface_id \u003d True"},{"line_number":2255,"context_line":"        self.assertTrue(found_iface_id)"},{"line_number":2256,"context_line":"        self.assertEqual(num_found, num_iface_ids)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_3060aace","line":2253,"in_reply_to":"baada198_3f607dce","updated":"2014-07-04 15:29:57.000000000","message":"Done","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":2259,"context_line":"        self.conn.attach_interface(self.instance, self.image, vif)"},{"line_number":2260,"context_line":"        self._validate_interfaces(vif[\u0027id\u0027], 1, 2)"},{"line_number":2261,"context_line":""},{"line_number":2262,"context_line":"    def test_attach_interface(self):"},{"line_number":2263,"context_line":"        self._create_vm()"},{"line_number":2264,"context_line":"        vif \u003d self._create_vif()"},{"line_number":2265,"context_line":"        self._attach_interface(vif)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_ea42c53c","line":2262,"updated":"2014-07-04 14:42:10.000000000","message":"Anything calling _detach_interface() below is a strict superset of this test. You could omit it.","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":2259,"context_line":"        self.conn.attach_interface(self.instance, self.image, vif)"},{"line_number":2260,"context_line":"        self._validate_interfaces(vif[\u0027id\u0027], 1, 2)"},{"line_number":2261,"context_line":""},{"line_number":2262,"context_line":"    def test_attach_interface(self):"},{"line_number":2263,"context_line":"        self._create_vm()"},{"line_number":2264,"context_line":"        vif \u003d self._create_vif()"},{"line_number":2265,"context_line":"        self._attach_interface(vif)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_f097128e","line":2262,"in_reply_to":"baada198_ea42c53c","updated":"2014-07-04 15:29:57.000000000","message":"i would prefer not to. in this case it is better to have a specific case.","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":2271,"context_line":"        with ("},{"line_number":2272,"context_line":"            mock.patch.object(self.conn._session, \u0027_wait_for_task\u0027,"},{"line_number":2273,"context_line":"                              side_effect\u003dException)"},{"line_number":2274,"context_line":"        ):"},{"line_number":2275,"context_line":"            self.assertRaises(exception.InterfaceAttachFailed,"},{"line_number":2276,"context_line":"                              self.conn.attach_interface,"},{"line_number":2277,"context_line":"                              self.instance, self.image, vif)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_dfd4e1be","line":2274,"updated":"2014-07-04 14:42:10.000000000","message":"nit: parens enclosing mock.patch.object() are superfluous","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":2271,"context_line":"        with ("},{"line_number":2272,"context_line":"            mock.patch.object(self.conn._session, \u0027_wait_for_task\u0027,"},{"line_number":2273,"context_line":"                              side_effect\u003dException)"},{"line_number":2274,"context_line":"        ):"},{"line_number":2275,"context_line":"            self.assertRaises(exception.InterfaceAttachFailed,"},{"line_number":2276,"context_line":"                              self.conn.attach_interface,"},{"line_number":2277,"context_line":"                              self.instance, self.image, vif)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_10956686","line":2274,"in_reply_to":"baada198_dfd4e1be","updated":"2014-07-04 15:29:57.000000000","message":"Done","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":2319,"context_line":"        with ("},{"line_number":2320,"context_line":"            mock.patch.object(self.conn._session, \u0027_wait_for_task\u0027,"},{"line_number":2321,"context_line":"                              side_effect\u003dException)"},{"line_number":2322,"context_line":"        ):"},{"line_number":2323,"context_line":"            self.assertRaises(exception.InterfaceDetachFailed,"},{"line_number":2324,"context_line":"                              self.conn.detach_interface,"},{"line_number":2325,"context_line":"                              self.instance, vif)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_ea73a57d","line":2322,"updated":"2014-07-04 14:42:10.000000000","message":"nit: superfluous parens again","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":2319,"context_line":"        with ("},{"line_number":2320,"context_line":"            mock.patch.object(self.conn._session, \u0027_wait_for_task\u0027,"},{"line_number":2321,"context_line":"                              side_effect\u003dException)"},{"line_number":2322,"context_line":"        ):"},{"line_number":2323,"context_line":"            self.assertRaises(exception.InterfaceDetachFailed,"},{"line_number":2324,"context_line":"                              self.conn.detach_interface,"},{"line_number":2325,"context_line":"                              self.instance, vif)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_30e50a38","line":2322,"in_reply_to":"baada198_ea73a57d","updated":"2014-07-04 15:29:57.000000000","message":"Done","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"}],"nova/tests/virt/vmwareapi/test_vm_util.py":[{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"1b1c81d2bc4068256b23e6a0333178750e7b55bb","unresolved":false,"context_lines":[{"line_number":937,"context_line":"        self.assertEqual(expected, result)"},{"line_number":938,"context_line":""},{"line_number":939,"context_line":"    def test_get_network_detach_config_spec(self):"},{"line_number":940,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":38,"id":"1ae5cdf2_715a4e51","line":940,"updated":"2014-06-26 10:48:41.000000000","message":"missed to implement this one? :)","commit_id":"e596bc6a0c845e6441170430cc2bfbac409ab90b"}],"nova/virt/vmwareapi/constants.py":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from nova.network import model as network_model"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"DEFAULT_VIF_MODEL \u003d network_model.VIF_MODEL_E1000"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_4abf31aa","line":22,"updated":"2014-07-04 14:42:10.000000000","message":"Yeay, merge conflict!\n\nI wonder if we should split the creation of this file into a separate commit. You could then base this change on it. I could base the vmware_images stuff on it, and you could rebase your other patch which uses it, too. A tiny patch like this would hopefully have a speedy path into master.\n\nUp to you.","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from nova.network import model as network_model"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"DEFAULT_VIF_MODEL \u003d network_model.VIF_MODEL_E1000"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_ca47c175","line":22,"in_reply_to":"baada198_4abf31aa","updated":"2014-07-04 15:29:57.000000000","message":"at the moment this patch is based on https://review.openstack.org/#/c/91005/. I\u0027ll do that.","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"}],"nova/virt/vmwareapi/driver.py":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":793,"context_line":""},{"line_number":794,"context_line":"    def attach_interface(self, instance, image_meta, vif):"},{"line_number":795,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":796,"context_line":"        _vmops \u003d self._get_vmops_for_compute_node(instance[\u0027node\u0027])"},{"line_number":797,"context_line":"        _vmops.attach_interface(instance, image_meta, vif)"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"    def detach_interface(self, instance, vif):"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_6cb71187","line":796,"updated":"2014-07-02 15:04:21.000000000","message":"This uses an object now. Could be instance.node. (Same below)","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":793,"context_line":""},{"line_number":794,"context_line":"    def attach_interface(self, instance, image_meta, vif):"},{"line_number":795,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":796,"context_line":"        _vmops \u003d self._get_vmops_for_compute_node(instance[\u0027node\u0027])"},{"line_number":797,"context_line":"        _vmops.attach_interface(instance, image_meta, vif)"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"    def detach_interface(self, instance, vif):"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_bacbf01c","line":796,"in_reply_to":"baada198_6cb71187","updated":"2014-07-03 10:28:44.000000000","message":"Done","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"}],"nova/virt/vmwareapi/vif.py":[{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":178,"context_line":"def get_network_device(hardware_devices, mac_address):"},{"line_number":179,"context_line":"    \"\"\"Return the network device with MAC \u0027mac_address\u0027.\"\"\""},{"line_number":180,"context_line":"    if hardware_devices.__class__.__name__ \u003d\u003d \"ArrayOfVirtualDevice\":"},{"line_number":181,"context_line":"        hardware_devices \u003d hardware_devices.VirtualDevice"},{"line_number":182,"context_line":"    for device in hardware_devices:"},{"line_number":183,"context_line":"        if device.__class__.__name__ in vm_util.ALL_SUPPORTED_NETWORK_DEVICES:"},{"line_number":184,"context_line":"            if hasattr(device, \u0027macAddress\u0027):"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_4f2cfc02","line":181,"updated":"2014-07-02 15:04:21.000000000","message":"This is *really* ugly. The caller should know for certain whether this is the case. The caller can simply pass in the correct array.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":178,"context_line":"def get_network_device(hardware_devices, mac_address):"},{"line_number":179,"context_line":"    \"\"\"Return the network device with MAC \u0027mac_address\u0027.\"\"\""},{"line_number":180,"context_line":"    if hardware_devices.__class__.__name__ \u003d\u003d \"ArrayOfVirtualDevice\":"},{"line_number":181,"context_line":"        hardware_devices \u003d hardware_devices.VirtualDevice"},{"line_number":182,"context_line":"    for device in hardware_devices:"},{"line_number":183,"context_line":"        if device.__class__.__name__ in vm_util.ALL_SUPPORTED_NETWORK_DEVICES:"},{"line_number":184,"context_line":"            if hasattr(device, \u0027macAddress\u0027):"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_1ab13c8f","line":181,"in_reply_to":"baada198_4f2cfc02","updated":"2014-07-03 10:28:44.000000000","message":"i am not sure that i understand your comment. this is how we parse the hardware devices of a virtual machine. we can certainly look at improving this and having a utility class - but that is out of the scope of this task.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"482870a5e786f18a934d3387a2e157f5aad0743a","unresolved":false,"context_lines":[{"line_number":178,"context_line":"def get_network_device(hardware_devices, mac_address):"},{"line_number":179,"context_line":"    \"\"\"Return the network device with MAC \u0027mac_address\u0027.\"\"\""},{"line_number":180,"context_line":"    if hardware_devices.__class__.__name__ \u003d\u003d \"ArrayOfVirtualDevice\":"},{"line_number":181,"context_line":"        hardware_devices \u003d hardware_devices.VirtualDevice"},{"line_number":182,"context_line":"    for device in hardware_devices:"},{"line_number":183,"context_line":"        if device.__class__.__name__ in vm_util.ALL_SUPPORTED_NETWORK_DEVICES:"},{"line_number":184,"context_line":"            if hasattr(device, \u0027macAddress\u0027):"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_633e092a","line":181,"updated":"2014-07-03 15:19:07.000000000","message":"Continuing from our previous comment discussion in patch 40.\n\nget_network_device() expects hardware_devices to be of type device[] (would that python actually had meaningful types, but moving on). What you\u0027ve done above is said that it might be this or it might be that, and we\u0027ll do some introspection to find out which. Don\u0027t do that! Assert that the caller passes in the correct type. The only reason you might do something like this is if the function was used in a ton of different places and you needed to maintain backwards compatibility because you\u0027re using some half-assed language without a compiler to help you find things like this automatically. This is currently completely unnecessary as there\u0027s only 1 caller.","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"9bb639c6ed170f4eb7b30a950fbd0e24a1b6bc06","unresolved":false,"context_lines":[{"line_number":178,"context_line":"def get_network_device(hardware_devices, mac_address):"},{"line_number":179,"context_line":"    \"\"\"Return the network device with MAC \u0027mac_address\u0027.\"\"\""},{"line_number":180,"context_line":"    if hardware_devices.__class__.__name__ \u003d\u003d \"ArrayOfVirtualDevice\":"},{"line_number":181,"context_line":"        hardware_devices \u003d hardware_devices.VirtualDevice"},{"line_number":182,"context_line":"    for device in hardware_devices:"},{"line_number":183,"context_line":"        if device.__class__.__name__ in vm_util.ALL_SUPPORTED_NETWORK_DEVICES:"},{"line_number":184,"context_line":"            if hasattr(device, \u0027macAddress\u0027):"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_5456125d","line":181,"in_reply_to":"baada198_633e092a","updated":"2014-07-03 19:08:31.000000000","message":"i need to think about this one. i am not ignoring the comment but i need to do some homework here. i may propose doing this in a seperate patch set as it is relevant to a number of others place too","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"}],"nova/virt/vmwareapi/vm_util.py":[{"author":{"_account_id":9754,"name":"ChiHsiang Su","email":"ksu@vmware.com"},"change_message_id":"c68218f48db525aedd19611be0f23f65801ca8fc","unresolved":false,"context_lines":[{"line_number":219,"context_line":"    vif_spec \u003d create_network_spec(client_factory, vif_info)"},{"line_number":220,"context_line":"    config_spec.deviceChange \u003d [vif_spec]"},{"line_number":221,"context_line":"    if vif_info[\u0027iface_id\u0027]:"},{"line_number":222,"context_line":"        config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":223,"context_line":"                                                        vif_info[\u0027iface_id\u0027],"},{"line_number":224,"context_line":"                                                        index)]"},{"line_number":225,"context_line":"    return config_spec"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F85vo%3D","line":222,"updated":"2013-12-19 00:49:31.000000000","message":"My understanding for vm configSpec.extraConfig[] is that it\u0027s an overwriting spec. Applying a spec of {2\u003dd} to an original value of {1\u003da, 2\u003db, 3\u003dc} will result in a value of {2\u003dd}, i.e. key 1 and 3 are removed.\n\nWith such a vm configSpec returned from this function, the vm.reconfigure operation will remove all other keys in the existing extraConfig, except for the iface_id key for this vnic.\n\nCan you confirm whether this is the behavior you observed?","commit_id":"5fb44912ce8190414f4ad238cf44703acbb40232"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"fa9452b874f94b78cf88b57ec119c8466ec7fbdb","unresolved":false,"context_lines":[{"line_number":219,"context_line":"    vif_spec \u003d create_network_spec(client_factory, vif_info)"},{"line_number":220,"context_line":"    config_spec.deviceChange \u003d [vif_spec]"},{"line_number":221,"context_line":"    if vif_info[\u0027iface_id\u0027]:"},{"line_number":222,"context_line":"        config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":223,"context_line":"                                                        vif_info[\u0027iface_id\u0027],"},{"line_number":224,"context_line":"                                                        index)]"},{"line_number":225,"context_line":"    return config_spec"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8s38%3D","line":222,"in_reply_to":"AAAATn%2F85vo%3D","updated":"2013-12-22 16:26:46.000000000","message":"A value for the extraConfig cannot be deleted. It can only be updated. Please see http://pubs.vmware.com/vsphere-51/index.jsp#com.vmware.wssdk.apiref.doc/vim.vm.ConfigSpec.html - this is the comment for the extraConfig - Additional configuration information for the virtual machine. This describes a set of modifications to the additional options. If the key is already present, it will be reset with the new value provided. Otherwise, a new option is added. An option cannot be removed.\n\nConfiguration keys that would conflict with parameters that are explicitly configurable through other fields in the ConfigSpec object are silently ignored.\n\nReconfigure privilege: VirtualMachine.Config.AdvancedConfig (also required when setting this property while creating a virtual machine)","commit_id":"5fb44912ce8190414f4ad238cf44703acbb40232"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"8e63c7d7dfecbc7170ed4c83aa57fcb114c04d8f","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"ALL_SUPPORTED_NETWORK_DEVICES \u003d [\u0027VirtualE1000\u0027, \u0027VirtualE1000e\u0027,"},{"line_number":35,"context_line":"                                 \u0027VirtualPCNet32\u0027, \u0027VirtualSriovEthernetCard\u0027,"},{"line_number":36,"context_line":"                                 \u0027VirtualVmxnet\u0027]"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAVX%2F%2F8%2FM%3D","line":34,"updated":"2014-02-27 06:54:01.000000000","message":"might be a dumb question but I guess these aren\u0027t models that should also be defined here: https://review.openstack.org/#/c/72292/9/nova/network/model.py ?","commit_id":"5c2aee6845c58ebe23af6d8945653ea2b78f173f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0c3616830b3e0d5e39ea87dd212e667d7174f412","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"ALL_SUPPORTED_NETWORK_DEVICES \u003d [\u0027VirtualE1000\u0027, \u0027VirtualE1000e\u0027,"},{"line_number":35,"context_line":"                                 \u0027VirtualPCNet32\u0027, \u0027VirtualSriovEthernetCard\u0027,"},{"line_number":36,"context_line":"                                 \u0027VirtualVmxnet\u0027]"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAVX%2F%2F5oE%3D","line":34,"in_reply_to":"AAAAVX%2F%2F8%2FM%3D","updated":"2014-02-27 14:09:35.000000000","message":"i think that these are ok as these are the internal vmware ones and not shared by other drivers","commit_id":"5c2aee6845c58ebe23af6d8945653ea2b78f173f"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"8694ed79f4a11084e70a12804ac41fbaa8852336","unresolved":false,"context_lines":[{"line_number":286,"context_line":"    virtual_device_config.operation \u003d \"remove\""},{"line_number":287,"context_line":"    virtual_device_config.device \u003d device"},{"line_number":288,"context_line":"    config_spec.deviceChange \u003d [virtual_device_config]"},{"line_number":289,"context_line":"    # If a key is aready present then it cannot be deleted, only updated."},{"line_number":290,"context_line":"    # This enables us to reuse this key if there is an additional"},{"line_number":291,"context_line":"    # attachment."},{"line_number":292,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXX%2F%2Fvv8%3D","line":289,"updated":"2014-04-28 09:35:58.000000000","message":"This is not true. The vSphere API allows you to remove extraConfig properties:\n\n\"Keys with empty values will be removed.\"\n\nis there any other reason why you prefer to update with a special value?","commit_id":"0f66b15b83ed437a67d9a4b915a5de815dbbc269"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4aab9302dac4995f50cac6b8d30c658fe8b11db8","unresolved":false,"context_lines":[{"line_number":286,"context_line":"    virtual_device_config.operation \u003d \"remove\""},{"line_number":287,"context_line":"    virtual_device_config.device \u003d device"},{"line_number":288,"context_line":"    config_spec.deviceChange \u003d [virtual_device_config]"},{"line_number":289,"context_line":"    # If a key is aready present then it cannot be deleted, only updated."},{"line_number":290,"context_line":"    # This enables us to reuse this key if there is an additional"},{"line_number":291,"context_line":"    # attachment."},{"line_number":292,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXX%2F%2FvPY%3D","line":289,"in_reply_to":"AAAAXX%2F%2Fvv8%3D","updated":"2014-04-28 11:03:03.000000000","message":"This is related to how the networking treats the configuration parameter. We cannot delete it. This is VC specific regarding the neutron support.","commit_id":"0f66b15b83ed437a67d9a4b915a5de815dbbc269"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"602256ea2a173208a88a51135c047cd61d7dc291","unresolved":false,"context_lines":[{"line_number":292,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":293,"context_line":"                                                    \u0027free\u0027,"},{"line_number":294,"context_line":"                                                    port_index)]"},{"line_number":295,"context_line":"    return config_spec"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"def get_vmdk_attach_config_spec(client_factory,"}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_b309b997","line":295,"updated":"2014-04-30 17:37:58.000000000","message":"Where are the tests for these?","commit_id":"e7f9ac660ebb92aa13c7cdfec0fb6fefd53197c1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e1d5ecc8a9ec7afdef2e7dfaca2111ca5a7f30ed","unresolved":false,"context_lines":[{"line_number":292,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":293,"context_line":"                                                    \u0027free\u0027,"},{"line_number":294,"context_line":"                                                    port_index)]"},{"line_number":295,"context_line":"    return config_spec"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"def get_vmdk_attach_config_spec(client_factory,"}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_1cefbb1f","line":295,"in_reply_to":"9ad9bd40_b309b997","updated":"2014-05-04 12:46:38.000000000","message":"Done","commit_id":"e7f9ac660ebb92aa13c7cdfec0fb6fefd53197c1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"602256ea2a173208a88a51135c047cd61d7dc291","unresolved":false,"context_lines":[{"line_number":1562,"context_line":"        for option in options:"},{"line_number":1563,"context_line":"            if (option.key.startswith(\u0027nvp.iface-id.\u0027) and"},{"line_number":1564,"context_line":"                option.value \u003d\u003d iface_id):"},{"line_number":1565,"context_line":"                return int(option.key.split(\u0027.\u0027)[2])"}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_13f8a57b","line":1565,"updated":"2014-04-30 17:37:58.000000000","message":"And these?","commit_id":"e7f9ac660ebb92aa13c7cdfec0fb6fefd53197c1"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"4c4629911a4c4de3927d66a4e6ceb693f83676b5","unresolved":false,"context_lines":[{"line_number":1573,"context_line":"    return dictionary"},{"line_number":1574,"context_line":""},{"line_number":1575,"context_line":""},{"line_number":1576,"context_line":"def get_network_device(hardware_devices, mac_address):"},{"line_number":1577,"context_line":"    \"\"\"Return the network device with MAC \u0027mac_address\u0027.\"\"\""},{"line_number":1578,"context_line":"    if hardware_devices.__class__.__name__ \u003d\u003d \"ArrayOfVirtualDevice\":"},{"line_number":1579,"context_line":"        hardware_devices \u003d hardware_devices.VirtualDevice"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_03538916","line":1576,"updated":"2014-06-26 06:26:36.000000000","message":"move this to vif.py?","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c54dab339f8f5d146347589bdb506cd9ac4a2bbd","unresolved":false,"context_lines":[{"line_number":1573,"context_line":"    return dictionary"},{"line_number":1574,"context_line":""},{"line_number":1575,"context_line":""},{"line_number":1576,"context_line":"def get_network_device(hardware_devices, mac_address):"},{"line_number":1577,"context_line":"    \"\"\"Return the network device with MAC \u0027mac_address\u0027.\"\"\""},{"line_number":1578,"context_line":"    if hardware_devices.__class__.__name__ \u003d\u003d \"ArrayOfVirtualDevice\":"},{"line_number":1579,"context_line":"        hardware_devices \u003d hardware_devices.VirtualDevice"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_6639b6d7","line":1576,"in_reply_to":"1ae5cdf2_03538916","updated":"2014-06-26 10:05:55.000000000","message":"Done","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"4c4629911a4c4de3927d66a4e6ceb693f83676b5","unresolved":false,"context_lines":[{"line_number":1600,"context_line":""},{"line_number":1601,"context_line":""},{"line_number":1602,"context_line":"def get_attach_port_index(session, vm_ref):"},{"line_number":1603,"context_line":"    # Get the first free port index"},{"line_number":1604,"context_line":"    ports \u003d _get_vm_port_indices(session, vm_ref)"},{"line_number":1605,"context_line":"    # No ports are configured on the VM"},{"line_number":1606,"context_line":"    if not ports:"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_e32a1d7d","line":1603,"updated":"2014-06-26 06:26:36.000000000","message":"nit: please use the docstring format; one can think this comment is for the next line","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c54dab339f8f5d146347589bdb506cd9ac4a2bbd","unresolved":false,"context_lines":[{"line_number":1600,"context_line":""},{"line_number":1601,"context_line":""},{"line_number":1602,"context_line":"def get_attach_port_index(session, vm_ref):"},{"line_number":1603,"context_line":"    # Get the first free port index"},{"line_number":1604,"context_line":"    ports \u003d _get_vm_port_indices(session, vm_ref)"},{"line_number":1605,"context_line":"    # No ports are configured on the VM"},{"line_number":1606,"context_line":"    if not ports:"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_664a9628","line":1603,"in_reply_to":"1ae5cdf2_e32a1d7d","updated":"2014-06-26 10:05:55.000000000","message":"Done","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"4c4629911a4c4de3927d66a4e6ceb693f83676b5","unresolved":false,"context_lines":[{"line_number":1606,"context_line":"    if not ports:"},{"line_number":1607,"context_line":"        return 0"},{"line_number":1608,"context_line":"    ports.sort()"},{"line_number":1609,"context_line":"    configured_ports \u003d len(ports)"},{"line_number":1610,"context_line":"    # Find the first free port index"},{"line_number":1611,"context_line":"    for port_index in range(configured_ports):"},{"line_number":1612,"context_line":"        if port_index !\u003d ports[port_index]:"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_c34c4179","line":1609,"updated":"2014-06-26 06:26:36.000000000","message":"nit: rename to configured_ports_len or something like this","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c54dab339f8f5d146347589bdb506cd9ac4a2bbd","unresolved":false,"context_lines":[{"line_number":1606,"context_line":"    if not ports:"},{"line_number":1607,"context_line":"        return 0"},{"line_number":1608,"context_line":"    ports.sort()"},{"line_number":1609,"context_line":"    configured_ports \u003d len(ports)"},{"line_number":1610,"context_line":"    # Find the first free port index"},{"line_number":1611,"context_line":"    for port_index in range(configured_ports):"},{"line_number":1612,"context_line":"        if port_index !\u003d ports[port_index]:"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_46de7a3f","line":1609,"in_reply_to":"1ae5cdf2_c34c4179","updated":"2014-06-26 10:05:55.000000000","message":"Done","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":270,"context_line":"def get_network_attach_config_spec(client_factory, vif_info, index):"},{"line_number":271,"context_line":"    \"\"\"Builds the vif attach config spec.\"\"\""},{"line_number":272,"context_line":"    config_spec \u003d client_factory.create(\u0027ns0:VirtualMachineConfigSpec\u0027)"},{"line_number":273,"context_line":"    vif_spec \u003d create_network_spec(client_factory, vif_info)"},{"line_number":274,"context_line":"    config_spec.deviceChange \u003d [vif_spec]"},{"line_number":275,"context_line":"    if vif_info[\u0027iface_id\u0027]:"},{"line_number":276,"context_line":"        config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_52b73fd8","line":273,"updated":"2014-07-02 15:04:21.000000000","message":"Not a problem in this patch, but reading this suggests to me that create_network_spec() is poorly named. It should probably be create_vif_spec(), or something suggesting that it returns a network device spec rather than a network spec.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":270,"context_line":"def get_network_attach_config_spec(client_factory, vif_info, index):"},{"line_number":271,"context_line":"    \"\"\"Builds the vif attach config spec.\"\"\""},{"line_number":272,"context_line":"    config_spec \u003d client_factory.create(\u0027ns0:VirtualMachineConfigSpec\u0027)"},{"line_number":273,"context_line":"    vif_spec \u003d create_network_spec(client_factory, vif_info)"},{"line_number":274,"context_line":"    config_spec.deviceChange \u003d [vif_spec]"},{"line_number":275,"context_line":"    if vif_info[\u0027iface_id\u0027]:"},{"line_number":276,"context_line":"        config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_9a32ac0e","line":273,"in_reply_to":"baada198_52b73fd8","updated":"2014-07-03 10:28:44.000000000","message":"Done","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":272,"context_line":"    config_spec \u003d client_factory.create(\u0027ns0:VirtualMachineConfigSpec\u0027)"},{"line_number":273,"context_line":"    vif_spec \u003d create_network_spec(client_factory, vif_info)"},{"line_number":274,"context_line":"    config_spec.deviceChange \u003d [vif_spec]"},{"line_number":275,"context_line":"    if vif_info[\u0027iface_id\u0027]:"},{"line_number":276,"context_line":"        config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":277,"context_line":"                                                        vif_info[\u0027iface_id\u0027],"},{"line_number":278,"context_line":"                                                        index)]"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_d220af4b","line":275,"updated":"2014-07-02 15:04:21.000000000","message":"What do you mean here:\n\n1. if vif_info[\u0027iface_id\u0027] is not None\n\n2. if \u0027iface_id\u0027 in vif_info\n\nIf 2 then the above will result in a key error if not present. If 1 you should be explicit.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":272,"context_line":"    config_spec \u003d client_factory.create(\u0027ns0:VirtualMachineConfigSpec\u0027)"},{"line_number":273,"context_line":"    vif_spec \u003d create_network_spec(client_factory, vif_info)"},{"line_number":274,"context_line":"    config_spec.deviceChange \u003d [vif_spec]"},{"line_number":275,"context_line":"    if vif_info[\u0027iface_id\u0027]:"},{"line_number":276,"context_line":"        config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":277,"context_line":"                                                        vif_info[\u0027iface_id\u0027],"},{"line_number":278,"context_line":"                                                        index)]"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_6818b375","line":275,"in_reply_to":"baada198_d220af4b","updated":"2014-07-03 10:28:44.000000000","message":"iface_id is always present.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":287,"context_line":"    virtual_device_config.operation \u003d \"remove\""},{"line_number":288,"context_line":"    virtual_device_config.device \u003d device"},{"line_number":289,"context_line":"    config_spec.deviceChange \u003d [virtual_device_config]"},{"line_number":290,"context_line":"    # If a key is aready present then it cannot be deleted, only updated."},{"line_number":291,"context_line":"    # This enables us to reuse this key if there is an additional"},{"line_number":292,"context_line":"    # attachment."},{"line_number":293,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_b2d5fbba","line":290,"updated":"2014-07-02 15:04:21.000000000","message":"nit: already","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":287,"context_line":"    virtual_device_config.operation \u003d \"remove\""},{"line_number":288,"context_line":"    virtual_device_config.device \u003d device"},{"line_number":289,"context_line":"    config_spec.deviceChange \u003d [virtual_device_config]"},{"line_number":290,"context_line":"    # If a key is aready present then it cannot be deleted, only updated."},{"line_number":291,"context_line":"    # This enables us to reuse this key if there is an additional"},{"line_number":292,"context_line":"    # attachment."},{"line_number":293,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_8828a787","line":290,"in_reply_to":"baada198_b2d5fbba","updated":"2014-07-03 10:28:44.000000000","message":"Done","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":289,"context_line":"    config_spec.deviceChange \u003d [virtual_device_config]"},{"line_number":290,"context_line":"    # If a key is aready present then it cannot be deleted, only updated."},{"line_number":291,"context_line":"    # This enables us to reuse this key if there is an additional"},{"line_number":292,"context_line":"    # attachment."},{"line_number":293,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":294,"context_line":"                                                    \u0027free\u0027,"},{"line_number":295,"context_line":"                                                    port_index)]"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_4d75e496","line":292,"updated":"2014-07-02 15:04:21.000000000","message":"According to the docs you can remove a key.\n\nhttp://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.wssdk.apiref.doc/vim.vm.ConfigSpec.html says of extraConfig:\n\nAdditional configuration information for the virtual machine. This describes a set of modifications to the additional options. If the key is already present, it will be reset with the new value provided. Otherwise, a new option is added. Keys with empty values will be removed.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":289,"context_line":"    config_spec.deviceChange \u003d [virtual_device_config]"},{"line_number":290,"context_line":"    # If a key is aready present then it cannot be deleted, only updated."},{"line_number":291,"context_line":"    # This enables us to reuse this key if there is an additional"},{"line_number":292,"context_line":"    # attachment."},{"line_number":293,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":294,"context_line":"                                                    \u0027free\u0027,"},{"line_number":295,"context_line":"                                                    port_index)]"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_884fc76a","line":292,"in_reply_to":"baada198_4d75e496","updated":"2014-07-03 10:28:44.000000000","message":"This is more of an internal issue on the ESX. We need to preserve the order and cannot remove them. Empty keys are removed, but that causes problems in this specific case.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":292,"context_line":"    # attachment."},{"line_number":293,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":294,"context_line":"                                                    \u0027free\u0027,"},{"line_number":295,"context_line":"                                                    port_index)]"},{"line_number":296,"context_line":"    return config_spec"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_8d7d3c71","line":295,"updated":"2014-07-02 15:04:21.000000000","message":"\u0027free\u0027 and port_index are the wrong way round. This isn\u0027t going to work in any case.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":292,"context_line":"    # attachment."},{"line_number":293,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":294,"context_line":"                                                    \u0027free\u0027,"},{"line_number":295,"context_line":"                                                    port_index)]"},{"line_number":296,"context_line":"    return config_spec"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_688b5368","line":295,"in_reply_to":"baada198_8d7d3c71","updated":"2014-07-03 10:28:44.000000000","message":"Not sure I understand. This is the signature: _get_vif_info_option(client_factory, iface_id, port_index)\nthis works - you can check it:- please note that if you do not have vmware tools installed on your guest then you will need to stop the vm to detach the interface\n\nThe free is used to denote that the same nvp index can be reused.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":1582,"context_line":"                                        vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1583,"context_line":"                                        \u0027config.extraConfig\u0027)"},{"line_number":1584,"context_line":"    ports \u003d []"},{"line_number":1585,"context_line":"    if extra_config:"},{"line_number":1586,"context_line":"        options \u003d extra_config.OptionValue"},{"line_number":1587,"context_line":"        for option in options:"},{"line_number":1588,"context_line":"            if (option.key.startswith(\u0027nvp.iface-id.\u0027) and"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_6d8c6836","line":1585,"updated":"2014-07-02 15:04:21.000000000","message":"if extra_config is not None","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":1582,"context_line":"                                        vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1583,"context_line":"                                        \u0027config.extraConfig\u0027)"},{"line_number":1584,"context_line":"    ports \u003d []"},{"line_number":1585,"context_line":"    if extra_config:"},{"line_number":1586,"context_line":"        options \u003d extra_config.OptionValue"},{"line_number":1587,"context_line":"        for option in options:"},{"line_number":1588,"context_line":"            if (option.key.startswith(\u0027nvp.iface-id.\u0027) and"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_88eb4712","line":1585,"in_reply_to":"baada198_6d8c6836","updated":"2014-07-03 10:28:44.000000000","message":"Done","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":1586,"context_line":"        options \u003d extra_config.OptionValue"},{"line_number":1587,"context_line":"        for option in options:"},{"line_number":1588,"context_line":"            if (option.key.startswith(\u0027nvp.iface-id.\u0027) and"},{"line_number":1589,"context_line":"                    option.value !\u003d \u0027free\u0027):"},{"line_number":1590,"context_line":"                ports.append(int(option.key.split(\u0027.\u0027)[2]))"},{"line_number":1591,"context_line":"    return ports"},{"line_number":1592,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_0df20cd2","line":1589,"updated":"2014-07-02 15:04:21.000000000","message":"See above. Think you should remove these keys.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":1586,"context_line":"        options \u003d extra_config.OptionValue"},{"line_number":1587,"context_line":"        for option in options:"},{"line_number":1588,"context_line":"            if (option.key.startswith(\u0027nvp.iface-id.\u0027) and"},{"line_number":1589,"context_line":"                    option.value !\u003d \u0027free\u0027):"},{"line_number":1590,"context_line":"                ports.append(int(option.key.split(\u0027.\u0027)[2]))"},{"line_number":1591,"context_line":"    return ports"},{"line_number":1592,"context_line":""}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_a8d72b4a","line":1589,"in_reply_to":"baada198_0df20cd2","updated":"2014-07-03 10:28:44.000000000","message":"We need those to ensure that we presevre the order. So the keys are marked as free.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":7400,"name":"Tracy Jones","email":"tjones@vmware.com","username":"tracyajones"},"change_message_id":"ede9b26c85fce4e6ea541d98340ce7ccdc0819e3","unresolved":false,"context_lines":[{"line_number":1607,"context_line":""},{"line_number":1608,"context_line":""},{"line_number":1609,"context_line":"def get_vm_detach_port_index(session, vm_ref, iface_id):"},{"line_number":1610,"context_line":"    extra_config \u003d session._call_method(vim_util,"},{"line_number":1611,"context_line":"                                        \u0027get_dynamic_property\u0027,"},{"line_number":1612,"context_line":"                                        vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1613,"context_line":"                                        \u0027config.extraConfig\u0027)"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_5f523c14","line":1610,"updated":"2014-06-30 17:34:03.000000000","message":"nit - should this be _get_vm_detach....  for consistency?","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":1607,"context_line":""},{"line_number":1608,"context_line":""},{"line_number":1609,"context_line":"def get_vm_detach_port_index(session, vm_ref, iface_id):"},{"line_number":1610,"context_line":"    extra_config \u003d session._call_method(vim_util,"},{"line_number":1611,"context_line":"                                        \u0027get_dynamic_property\u0027,"},{"line_number":1612,"context_line":"                                        vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1613,"context_line":"                                        \u0027config.extraConfig\u0027)"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_4853efe1","line":1610,"in_reply_to":"baada198_5f523c14","updated":"2014-07-03 10:28:44.000000000","message":"this is used in vmops. why would we use a prefix of _?","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":1611,"context_line":"                                        \u0027get_dynamic_property\u0027,"},{"line_number":1612,"context_line":"                                        vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1613,"context_line":"                                        \u0027config.extraConfig\u0027)"},{"line_number":1614,"context_line":"    if extra_config:"},{"line_number":1615,"context_line":"        options \u003d extra_config.OptionValue"},{"line_number":1616,"context_line":"        for option in options:"},{"line_number":1617,"context_line":"            if (option.key.startswith(\u0027nvp.iface-id.\u0027) and"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_cd265416","line":1614,"updated":"2014-07-02 15:04:21.000000000","message":"if extra_config is not None","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"54c2880b88d95168207c3ecfc8b301595c724321","unresolved":false,"context_lines":[{"line_number":1611,"context_line":"                                        \u0027get_dynamic_property\u0027,"},{"line_number":1612,"context_line":"                                        vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1613,"context_line":"                                        \u0027config.extraConfig\u0027)"},{"line_number":1614,"context_line":"    if extra_config:"},{"line_number":1615,"context_line":"        options \u003d extra_config.OptionValue"},{"line_number":1616,"context_line":"        for option in options:"},{"line_number":1617,"context_line":"            if (option.key.startswith(\u0027nvp.iface-id.\u0027) and"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_6850b3d4","line":1614,"in_reply_to":"baada198_cd265416","updated":"2014-07-03 10:28:44.000000000","message":"Done","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"482870a5e786f18a934d3387a2e157f5aad0743a","unresolved":false,"context_lines":[{"line_number":95,"context_line":"VNC_CONFIG_KEY \u003d \u0027config.extraConfig[\"RemoteDisplay.vnc.port\"]\u0027"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def _get_vif_info_option(client_factory, iface_id, port_index):"},{"line_number":99,"context_line":"    opt \u003d client_factory.create(\u0027ns0:OptionValue\u0027)"},{"line_number":100,"context_line":"    opt.key \u003d \"nvp.iface-id.%d\" % port_index"},{"line_number":101,"context_line":"    opt.value \u003d iface_id"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_9e18d276","line":98,"updated":"2014-07-03 15:19:07.000000000","message":"This function signature is a source of confusion. It\u0027s creating an OptionValue, which is a key:value pair. However, the signature is value:key, which is counterintuitive.","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"9bb639c6ed170f4eb7b30a950fbd0e24a1b6bc06","unresolved":false,"context_lines":[{"line_number":95,"context_line":"VNC_CONFIG_KEY \u003d \u0027config.extraConfig[\"RemoteDisplay.vnc.port\"]\u0027"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"def _get_vif_info_option(client_factory, iface_id, port_index):"},{"line_number":99,"context_line":"    opt \u003d client_factory.create(\u0027ns0:OptionValue\u0027)"},{"line_number":100,"context_line":"    opt.key \u003d \"nvp.iface-id.%d\" % port_index"},{"line_number":101,"context_line":"    opt.value \u003d iface_id"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_54437241","line":98,"in_reply_to":"baada198_9e18d276","updated":"2014-07-03 19:08:31.000000000","message":"Done","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"482870a5e786f18a934d3387a2e157f5aad0743a","unresolved":false,"context_lines":[{"line_number":272,"context_line":"    config_spec \u003d client_factory.create(\u0027ns0:VirtualMachineConfigSpec\u0027)"},{"line_number":273,"context_line":"    vif_spec \u003d _create_vif_spec(client_factory, vif_info)"},{"line_number":274,"context_line":"    config_spec.deviceChange \u003d [vif_spec]"},{"line_number":275,"context_line":"    if vif_info[\u0027iface_id\u0027]:"},{"line_number":276,"context_line":"        config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":277,"context_line":"                                                        vif_info[\u0027iface_id\u0027],"},{"line_number":278,"context_line":"                                                        index)]"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_0871ecdf","line":275,"updated":"2014-07-03 15:19:07.000000000","message":"if vif_info[\u0027iface_id\u0027] is not None","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"9bb639c6ed170f4eb7b30a950fbd0e24a1b6bc06","unresolved":false,"context_lines":[{"line_number":272,"context_line":"    config_spec \u003d client_factory.create(\u0027ns0:VirtualMachineConfigSpec\u0027)"},{"line_number":273,"context_line":"    vif_spec \u003d _create_vif_spec(client_factory, vif_info)"},{"line_number":274,"context_line":"    config_spec.deviceChange \u003d [vif_spec]"},{"line_number":275,"context_line":"    if vif_info[\u0027iface_id\u0027]:"},{"line_number":276,"context_line":"        config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":277,"context_line":"                                                        vif_info[\u0027iface_id\u0027],"},{"line_number":278,"context_line":"                                                        index)]"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_74407634","line":275,"in_reply_to":"baada198_0871ecdf","updated":"2014-07-03 19:08:31.000000000","message":"Done","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"482870a5e786f18a934d3387a2e157f5aad0743a","unresolved":false,"context_lines":[{"line_number":289,"context_line":"    config_spec.deviceChange \u003d [virtual_device_config]"},{"line_number":290,"context_line":"    # If a key is already present then it cannot be deleted, only updated."},{"line_number":291,"context_line":"    # This enables us to reuse this key if there is an additional"},{"line_number":292,"context_line":"    # attachment."},{"line_number":293,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":294,"context_line":"                                                    \u0027free\u0027,"},{"line_number":295,"context_line":"                                                    port_index)]"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_5ecd5a84","line":292,"updated":"2014-07-03 15:19:07.000000000","message":"I see how this works now (I was confounded by the key:value inversion). However, I still don\u0027t understand why you can\u0027t delete a key when the docs say you can. If you simply deleted the key, then it would be reused automatically by the logic in get_attach_port_index() below.\n\nIf there is a good reason not to delete the key, you need to spell it out very clearly here. Otherwise you risk somebody coming along and cleaning it up later, only to have to re-learn why you shouldn\u0027t do that.","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"8de276c9163ddfd4e4399f7fec578f0502467455","unresolved":false,"context_lines":[{"line_number":289,"context_line":"    config_spec.deviceChange \u003d [virtual_device_config]"},{"line_number":290,"context_line":"    # If a key is already present then it cannot be deleted, only updated."},{"line_number":291,"context_line":"    # This enables us to reuse this key if there is an additional"},{"line_number":292,"context_line":"    # attachment."},{"line_number":293,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":294,"context_line":"                                                    \u0027free\u0027,"},{"line_number":295,"context_line":"                                                    port_index)]"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_b4285587","line":292,"in_reply_to":"baada198_5ecd5a84","updated":"2014-07-03 15:46:54.000000000","message":"Discussed this with garyk on IRC. There are 2 things at play here:\n\n1. Although you can delete keys in 5.5, you couldn\u0027t delete them in 5.1.\n\n2. There\u0027s interplay with NSX, which breaks if the nvp.iface-id.\u003c\u003e keys go away\n\nWe agreed that this needs a large comment block, but that this code is good.","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"9bb639c6ed170f4eb7b30a950fbd0e24a1b6bc06","unresolved":false,"context_lines":[{"line_number":289,"context_line":"    config_spec.deviceChange \u003d [virtual_device_config]"},{"line_number":290,"context_line":"    # If a key is already present then it cannot be deleted, only updated."},{"line_number":291,"context_line":"    # This enables us to reuse this key if there is an additional"},{"line_number":292,"context_line":"    # attachment."},{"line_number":293,"context_line":"    config_spec.extraConfig \u003d [_get_vif_info_option(client_factory,"},{"line_number":294,"context_line":"                                                    \u0027free\u0027,"},{"line_number":295,"context_line":"                                                    port_index)]"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_d49dc2bd","line":292,"in_reply_to":"baada198_b4285587","updated":"2014-07-03 19:08:31.000000000","message":"A value for the extraConfig cannot be deleted. It can only be updated. Please see http://pubs.vmware.com/vsphere-51/index.jsp#com.vmware.wssdk.apiref.doc/vim.vm.ConfigSpec.html - this is the comment for the extraConfig - Additional configuration information for the virtual machine. This describes a set of modifications to the additional options. If the key is already present, it will be reset with the new value provided. Otherwise, a new option is added. An option cannot be removed.\n\nConfiguration keys that would conflict with parameters that are explicitly configurable through other fields in the ConfigSpec object are silently ignored.\n\nReconfigure privilege: VirtualMachine.Config.AdvancedConfig (also required when setting this property while creating a virtual machine)\n\nI have also updated the comment","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":292,"context_line":"    # attachment. The keys need to be preserved. This is due to the fact"},{"line_number":293,"context_line":"    # that there is logic on the ESX that does the network wiring"},{"line_number":294,"context_line":"    # according to these values. If they are changed then this will"},{"line_number":295,"context_line":"    # break networking to and from the interface."},{"line_number":296,"context_line":"    config_spec.extraConfig \u003d [_iface_id_option_value(client_factory,"},{"line_number":297,"context_line":"                                                      \u0027free\u0027,"},{"line_number":298,"context_line":"                                                      port_index)]"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_aaa9ad91","line":295,"updated":"2014-07-04 14:42:10.000000000","message":"I hate to make a fuss about this, but I think this still needs to be more descriptive. If you\u0027re having trouble remembering exactly what\u0027s going on here now, imagine 12 months down the line.\n\nCan you describe the ESX logic in question? A link to the documentation would be even better.","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":292,"context_line":"    # attachment. The keys need to be preserved. This is due to the fact"},{"line_number":293,"context_line":"    # that there is logic on the ESX that does the network wiring"},{"line_number":294,"context_line":"    # according to these values. If they are changed then this will"},{"line_number":295,"context_line":"    # break networking to and from the interface."},{"line_number":296,"context_line":"    config_spec.extraConfig \u003d [_iface_id_option_value(client_factory,"},{"line_number":297,"context_line":"                                                      \u0027free\u0027,"},{"line_number":298,"context_line":"                                                      port_index)]"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_5067deb6","line":295,"in_reply_to":"baada198_aaa9ad91","updated":"2014-07-04 15:29:57.000000000","message":"sadly there is no public documentation","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"}],"nova/virt/vmwareapi/vmops.py":[{"author":{"_account_id":7476,"name":"kaitian521","email":"kaitian521@gmail.com"},"change_message_id":"0a78a02a120c783ed5c85ce06b9a5eccc53298d5","unresolved":false,"context_lines":[{"line_number":1588,"context_line":"        if not ports:"},{"line_number":1589,"context_line":"            return 0"},{"line_number":1590,"context_line":"        ports.sort()"},{"line_number":1591,"context_line":"        configured_ports \u003d len(ports)"},{"line_number":1592,"context_line":"        # Find the first free port index"},{"line_number":1593,"context_line":"        for port_index in range(configured_ports):"},{"line_number":1594,"context_line":"            if port_index !\u003d ports[port_index]:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2B4aQ%3D","line":1591,"updated":"2014-01-21 05:54:35.000000000","message":"just a simple NIT:)))  why not use\n\nfor (port_index, port) in enumerate(ports):\n    if port_index !\u003d port:\n        return port_index\n\nreturn configured_ports","commit_id":"45ee8deb65103855001c4fe5e088155eec49044f"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"f04005a441fdb3d3ad25d993922209c58ca3a289","unresolved":false,"context_lines":[{"line_number":1680,"context_line":"        instance_uuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1681,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1682,"context_line":""},{"line_number":1683,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\", \"VirtualE1000\")"},{"line_number":1684,"context_line":"        mac \u003d vif[\u0027address\u0027]"},{"line_number":1685,"context_line":"        name \u003d vif[\u0027network\u0027][\u0027bridge\u0027] or CONF.vmware.integration_bridge"},{"line_number":1686,"context_line":"        ref \u003d vmwarevif.get_network_ref(self._session,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2F6jk%3D","line":1683,"updated":"2014-02-09 23:42:05.000000000","message":"I think we need to register the possible values of hw_vif_model in some common place.  For example, this is using VirtualE1000, but the libvirt driver is supporting the same thing as \"e1000\".","commit_id":"38848fb0a06fd4b9d8ae885bb429fcf3c410efba"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1bd7b06232cfd885a9bf94039135e348f01e9f44","unresolved":false,"context_lines":[{"line_number":1680,"context_line":"        instance_uuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1681,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1682,"context_line":""},{"line_number":1683,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\", \"VirtualE1000\")"},{"line_number":1684,"context_line":"        mac \u003d vif[\u0027address\u0027]"},{"line_number":1685,"context_line":"        name \u003d vif[\u0027network\u0027][\u0027bridge\u0027] or CONF.vmware.integration_bridge"},{"line_number":1686,"context_line":"        ref \u003d vmwarevif.get_network_ref(self._session,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2F3%2BY%3D","line":1683,"in_reply_to":"AAAAUX%2F%2F6jk%3D","updated":"2014-02-10 08:40:24.000000000","message":"Please see - https://review.openstack.org/72292\nThis patch will now be based on that one.","commit_id":"38848fb0a06fd4b9d8ae885bb429fcf3c410efba"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5e56cf2ed19b1602229551c6694b1d5ffab8be53","unresolved":false,"context_lines":[{"line_number":1682,"context_line":"                    \u0027mac_address\u0027: mac,"},{"line_number":1683,"context_line":"                    \u0027network_ref\u0027: ref,"},{"line_number":1684,"context_line":"                    \u0027iface_id\u0027: vif[\u0027id\u0027],"},{"line_number":1685,"context_line":"                    \u0027vif_model\u0027: vif_model"},{"line_number":1686,"context_line":"                   }"},{"line_number":1687,"context_line":""},{"line_number":1688,"context_line":"        port_index \u003d self._get_attach_port_index(vm_ref)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUX%2F%2B9rM%3D","line":1685,"updated":"2014-02-17 23:47:55.000000000","message":"Where does this (\"e1000\" for example) get translated into the string you need for vmware, which is like VirtualE1000Blah or whatever?","commit_id":"47d6150ec87733b071476b283f08d150f4c18b95"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"12be2a321067ce47677150a6b09fd3caad92d8f7","unresolved":false,"context_lines":[{"line_number":1682,"context_line":"                    \u0027mac_address\u0027: mac,"},{"line_number":1683,"context_line":"                    \u0027network_ref\u0027: ref,"},{"line_number":1684,"context_line":"                    \u0027iface_id\u0027: vif[\u0027id\u0027],"},{"line_number":1685,"context_line":"                    \u0027vif_model\u0027: vif_model"},{"line_number":1686,"context_line":"                   }"},{"line_number":1687,"context_line":""},{"line_number":1688,"context_line":"        port_index \u003d self._get_attach_port_index(vm_ref)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUX%2F%2B3%2BY%3D","line":1685,"in_reply_to":"AAAAUX%2F%2B9rM%3D","updated":"2014-02-18 14:01:56.000000000","message":"The translation is done at - https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vm_util.py#L151","commit_id":"47d6150ec87733b071476b283f08d150f4c18b95"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5e56cf2ed19b1602229551c6694b1d5ffab8be53","unresolved":false,"context_lines":[{"line_number":1693,"context_line":"                                        self._session._get_vim(),"},{"line_number":1694,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1695,"context_line":"                                        spec\u003dnetwork_attach_config_spec)"},{"line_number":1696,"context_line":"        self._session._wait_for_task(instance_uuid, reconfig_task)"},{"line_number":1697,"context_line":"        LOG.debug(_(\"Reconfigured VM to attach interface\"), instance\u003dinstance)"},{"line_number":1698,"context_line":""},{"line_number":1699,"context_line":"    def _get_vm_detach_port_index(self, vm_ref, iface_id):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUX%2F%2B9q8%3D","line":1696,"updated":"2014-02-17 23:47:55.000000000","message":"When does InterfaceAttachFailed get raised if this operation fails? (surely it can fail, right?)","commit_id":"47d6150ec87733b071476b283f08d150f4c18b95"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"12be2a321067ce47677150a6b09fd3caad92d8f7","unresolved":false,"context_lines":[{"line_number":1693,"context_line":"                                        self._session._get_vim(),"},{"line_number":1694,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1695,"context_line":"                                        spec\u003dnetwork_attach_config_spec)"},{"line_number":1696,"context_line":"        self._session._wait_for_task(instance_uuid, reconfig_task)"},{"line_number":1697,"context_line":"        LOG.debug(_(\"Reconfigured VM to attach interface\"), instance\u003dinstance)"},{"line_number":1698,"context_line":""},{"line_number":1699,"context_line":"    def _get_vm_detach_port_index(self, vm_ref, iface_id):"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUX%2F%2B3xs%3D","line":1696,"in_reply_to":"AAAAUX%2F%2B9q8%3D","updated":"2014-02-18 14:01:56.000000000","message":"Done","commit_id":"47d6150ec87733b071476b283f08d150f4c18b95"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"12be2a321067ce47677150a6b09fd3caad92d8f7","unresolved":false,"context_lines":[{"line_number":1734,"context_line":"                                        self._session._get_vim(),"},{"line_number":1735,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1736,"context_line":"                                        spec\u003dnetwork_detach_config_spec)"},{"line_number":1737,"context_line":"        self._session._wait_for_task(instance_uuid, reconfig_task)"},{"line_number":1738,"context_line":"        LOG.debug(_(\"Reconfigured VM to detach interface\"), instance\u003dinstance)"},{"line_number":1739,"context_line":""},{"line_number":1740,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAUX%2F%2B3xo%3D","line":1737,"updated":"2014-02-18 14:01:56.000000000","message":"Ditto","commit_id":"47d6150ec87733b071476b283f08d150f4c18b95"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"3b61837c6e798f4228a705b5e58fa2cc03cc5a40","unresolved":false,"context_lines":[{"line_number":1697,"context_line":"        instance_uuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1698,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1699,"context_line":""},{"line_number":1700,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\", \"VirtualE1000\")"},{"line_number":1701,"context_line":"        mac \u003d vif[\u0027address\u0027]"},{"line_number":1702,"context_line":"        name \u003d vif[\u0027network\u0027][\u0027bridge\u0027] or CONF.vmware.integration_bridge"},{"line_number":1703,"context_line":"        ref \u003d vmwarevif.get_network_ref(self._session,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAVX%2F%2F6YQ%3D","line":1700,"updated":"2014-02-27 12:32:53.000000000","message":"Should be \n\n vif_model \u003d image_properties.get(\"hw_vif_model\", network_model.VIF_MODEL_E1000)","commit_id":"5c2aee6845c58ebe23af6d8945653ea2b78f173f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0c3616830b3e0d5e39ea87dd212e667d7174f412","unresolved":false,"context_lines":[{"line_number":1697,"context_line":"        instance_uuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1698,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1699,"context_line":""},{"line_number":1700,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\", \"VirtualE1000\")"},{"line_number":1701,"context_line":"        mac \u003d vif[\u0027address\u0027]"},{"line_number":1702,"context_line":"        name \u003d vif[\u0027network\u0027][\u0027bridge\u0027] or CONF.vmware.integration_bridge"},{"line_number":1703,"context_line":"        ref \u003d vmwarevif.get_network_ref(self._session,"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAVX%2F%2F5oU%3D","line":1700,"in_reply_to":"AAAAVX%2F%2F6YQ%3D","updated":"2014-02-27 14:09:35.000000000","message":"Done","commit_id":"5c2aee6845c58ebe23af6d8945653ea2b78f173f"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"3b61837c6e798f4228a705b5e58fa2cc03cc5a40","unresolved":false,"context_lines":[{"line_number":1708,"context_line":"                    \u0027mac_address\u0027: mac,"},{"line_number":1709,"context_line":"                    \u0027network_ref\u0027: ref,"},{"line_number":1710,"context_line":"                    \u0027iface_id\u0027: vif[\u0027id\u0027],"},{"line_number":1711,"context_line":"                    \u0027vif_model\u0027: vif_model"},{"line_number":1712,"context_line":"                   }"},{"line_number":1713,"context_line":""},{"line_number":1714,"context_line":"        port_index \u003d self._get_attach_port_index(vm_ref)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAVX%2F%2F6X8%3D","line":1711,"updated":"2014-02-27 12:32:53.000000000","message":"And per my comment on a previous patch, I think you ought todo something like\n\n\n    \u0027vif_model\u0027:  convert_vif_model_name(vif_model)\n\nto do the translation from common, to vmware specific model names.","commit_id":"5c2aee6845c58ebe23af6d8945653ea2b78f173f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0c3616830b3e0d5e39ea87dd212e667d7174f412","unresolved":false,"context_lines":[{"line_number":1708,"context_line":"                    \u0027mac_address\u0027: mac,"},{"line_number":1709,"context_line":"                    \u0027network_ref\u0027: ref,"},{"line_number":1710,"context_line":"                    \u0027iface_id\u0027: vif[\u0027id\u0027],"},{"line_number":1711,"context_line":"                    \u0027vif_model\u0027: vif_model"},{"line_number":1712,"context_line":"                   }"},{"line_number":1713,"context_line":""},{"line_number":1714,"context_line":"        port_index \u003d self._get_attach_port_index(vm_ref)"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAAVX%2F%2F5oM%3D","line":1711,"in_reply_to":"AAAAVX%2F%2F6X8%3D","updated":"2014-02-27 14:09:35.000000000","message":"Done","commit_id":"5c2aee6845c58ebe23af6d8945653ea2b78f173f"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"16e992950bf8a6b579304df8fbf54afe0e858bd5","unresolved":false,"context_lines":[{"line_number":275,"context_line":"                                                        self._cluster,"},{"line_number":276,"context_line":"                                                        vif,"},{"line_number":277,"context_line":"                                                        self._is_neutron)"},{"line_number":278,"context_line":"                vif_infos.append({\u0027network_name\u0027: network_name,"},{"line_number":279,"context_line":"                                  \u0027mac_address\u0027: mac_address,"},{"line_number":280,"context_line":"                                  \u0027network_ref\u0027: network_ref,"},{"line_number":281,"context_line":"                                  \u0027iface_id\u0027: vif[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FfXQ%3D","line":278,"updated":"2014-04-14 09:49:30.000000000","message":"It feels wrong not be be sharing code with here.\n\nMaybe the code in this change helps:\nhttps://review.openstack.org/#/c/81809/8/nova/virt/vmwareapi/vmops.py\n\nBut not sure its worth the delay at this point.","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c91c74c56e3100f5ec0e90ba1e1bed87de768a71","unresolved":false,"context_lines":[{"line_number":275,"context_line":"                                                        self._cluster,"},{"line_number":276,"context_line":"                                                        vif,"},{"line_number":277,"context_line":"                                                        self._is_neutron)"},{"line_number":278,"context_line":"                vif_infos.append({\u0027network_name\u0027: network_name,"},{"line_number":279,"context_line":"                                  \u0027mac_address\u0027: mac_address,"},{"line_number":280,"context_line":"                                  \u0027network_ref\u0027: network_ref,"},{"line_number":281,"context_line":"                                  \u0027iface_id\u0027: vif[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FVbc%3D","line":278,"in_reply_to":"AAAAW3%2F%2FfXQ%3D","updated":"2014-04-15 11:19:29.000000000","message":"I think that is is a minor issue that can be addressed when one of the two patches land. It is just matter or rebasing","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"16e992950bf8a6b579304df8fbf54afe0e858bd5","unresolved":false,"context_lines":[{"line_number":1624,"context_line":"    def _get_vm_port_indices(self, vm_ref):"},{"line_number":1625,"context_line":"        extra_config \u003d self._session._call_method(vim_util,"},{"line_number":1626,"context_line":"                                                  \u0027get_dynamic_property\u0027,"},{"line_number":1627,"context_line":"                                                  vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1628,"context_line":"                                                  \u0027config.extraConfig\u0027)"},{"line_number":1629,"context_line":"        ports \u003d []"},{"line_number":1630,"context_line":"        if extra_config:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FfFI%3D","line":1627,"updated":"2014-04-14 09:49:30.000000000","message":"feels like there should be a session method that helps you get dynamic properties, like session.VM.get_extra_config(vm_ref)","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c91c74c56e3100f5ec0e90ba1e1bed87de768a71","unresolved":false,"context_lines":[{"line_number":1624,"context_line":"    def _get_vm_port_indices(self, vm_ref):"},{"line_number":1625,"context_line":"        extra_config \u003d self._session._call_method(vim_util,"},{"line_number":1626,"context_line":"                                                  \u0027get_dynamic_property\u0027,"},{"line_number":1627,"context_line":"                                                  vm_ref, \u0027VirtualMachine\u0027,"},{"line_number":1628,"context_line":"                                                  \u0027config.extraConfig\u0027)"},{"line_number":1629,"context_line":"        ports \u003d []"},{"line_number":1630,"context_line":"        if extra_config:"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FVWM%3D","line":1627,"in_reply_to":"AAAAW3%2F%2FfFI%3D","updated":"2014-04-15 11:19:29.000000000","message":"this is basically what the _call_method does. not sure what we can gain from that","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"16e992950bf8a6b579304df8fbf54afe0e858bd5","unresolved":false,"context_lines":[{"line_number":1635,"context_line":"                    ports.append(int(option.key.split(\u0027.\u0027)[2]))"},{"line_number":1636,"context_line":"        return ports"},{"line_number":1637,"context_line":""},{"line_number":1638,"context_line":"    def _get_attach_port_index(self, vm_ref):"},{"line_number":1639,"context_line":"        # Get the first free port index"},{"line_number":1640,"context_line":"        ports \u003d self._get_vm_port_indices(vm_ref)"},{"line_number":1641,"context_line":"        # No ports are configured on the VM"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FfGI%3D","line":1638,"updated":"2014-04-14 09:49:30.000000000","message":"feels like this could be in vmutils? and it should have its own little unit test.","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c91c74c56e3100f5ec0e90ba1e1bed87de768a71","unresolved":false,"context_lines":[{"line_number":1635,"context_line":"                    ports.append(int(option.key.split(\u0027.\u0027)[2]))"},{"line_number":1636,"context_line":"        return ports"},{"line_number":1637,"context_line":""},{"line_number":1638,"context_line":"    def _get_attach_port_index(self, vm_ref):"},{"line_number":1639,"context_line":"        # Get the first free port index"},{"line_number":1640,"context_line":"        ports \u003d self._get_vm_port_indices(vm_ref)"},{"line_number":1641,"context_line":"        # No ports are configured on the VM"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FVWI%3D","line":1638,"in_reply_to":"AAAAW3%2F%2FfGI%3D","updated":"2014-04-15 11:19:29.000000000","message":"Done","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"16e992950bf8a6b579304df8fbf54afe0e858bd5","unresolved":false,"context_lines":[{"line_number":1653,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":1654,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1655,"context_line":"        instance_uuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1656,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1657,"context_line":""},{"line_number":1658,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1659,"context_line":"                                   network_model.VIF_MODEL_E1000)"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FfHk%3D","line":1656,"updated":"2014-04-14 09:49:30.000000000","message":"instance_uuid is not used here it seems, please move these others closer to where they are used.","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c91c74c56e3100f5ec0e90ba1e1bed87de768a71","unresolved":false,"context_lines":[{"line_number":1653,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":1654,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1655,"context_line":"        instance_uuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1656,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1657,"context_line":""},{"line_number":1658,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1659,"context_line":"                                   network_model.VIF_MODEL_E1000)"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FVVY%3D","line":1656,"in_reply_to":"AAAAW3%2F%2FfHk%3D","updated":"2014-04-15 11:19:29.000000000","message":"Done","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"16e992950bf8a6b579304df8fbf54afe0e858bd5","unresolved":false,"context_lines":[{"line_number":1656,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1657,"context_line":""},{"line_number":1658,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1659,"context_line":"                                   network_model.VIF_MODEL_E1000)"},{"line_number":1660,"context_line":"        mac \u003d vif[\u0027address\u0027]"},{"line_number":1661,"context_line":"        name \u003d vif[\u0027network\u0027][\u0027bridge\u0027] or CONF.vmware.integration_bridge"},{"line_number":1662,"context_line":"        ref \u003d vmwarevif.get_network_ref(self._session,"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FfHY%3D","line":1659,"updated":"2014-04-14 09:49:30.000000000","message":"feels like this should be a util function somewhere","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c91c74c56e3100f5ec0e90ba1e1bed87de768a71","unresolved":false,"context_lines":[{"line_number":1656,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1657,"context_line":""},{"line_number":1658,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1659,"context_line":"                                   network_model.VIF_MODEL_E1000)"},{"line_number":1660,"context_line":"        mac \u003d vif[\u0027address\u0027]"},{"line_number":1661,"context_line":"        name \u003d vif[\u0027network\u0027][\u0027bridge\u0027] or CONF.vmware.integration_bridge"},{"line_number":1662,"context_line":"        ref \u003d vmwarevif.get_network_ref(self._session,"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FVPg%3D","line":1659,"in_reply_to":"AAAAW3%2F%2FfHY%3D","updated":"2014-04-15 11:19:29.000000000","message":"Done","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"16e992950bf8a6b579304df8fbf54afe0e858bd5","unresolved":false,"context_lines":[{"line_number":1663,"context_line":"                                        self._cluster,"},{"line_number":1664,"context_line":"                                        vif,"},{"line_number":1665,"context_line":"                                        self._is_neutron)"},{"line_number":1666,"context_line":"        vif_info \u003d {\u0027network_name\u0027: name,"},{"line_number":1667,"context_line":"                    \u0027mac_address\u0027: mac,"},{"line_number":1668,"context_line":"                    \u0027network_ref\u0027: ref,"},{"line_number":1669,"context_line":"                    \u0027iface_id\u0027: vif[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FfG4%3D","line":1666,"updated":"2014-04-14 09:49:30.000000000","message":"please at least split out this vif_info building into another function.","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c91c74c56e3100f5ec0e90ba1e1bed87de768a71","unresolved":false,"context_lines":[{"line_number":1663,"context_line":"                                        self._cluster,"},{"line_number":1664,"context_line":"                                        vif,"},{"line_number":1665,"context_line":"                                        self._is_neutron)"},{"line_number":1666,"context_line":"        vif_info \u003d {\u0027network_name\u0027: name,"},{"line_number":1667,"context_line":"                    \u0027mac_address\u0027: mac,"},{"line_number":1668,"context_line":"                    \u0027network_ref\u0027: ref,"},{"line_number":1669,"context_line":"                    \u0027iface_id\u0027: vif[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FVPc%3D","line":1666,"in_reply_to":"AAAAW3%2F%2FfG4%3D","updated":"2014-04-15 11:19:29.000000000","message":"Done","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"16e992950bf8a6b579304df8fbf54afe0e858bd5","unresolved":false,"context_lines":[{"line_number":1679,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1680,"context_line":"                                        spec\u003dnetwork_attach_config_spec)"},{"line_number":1681,"context_line":"        try:"},{"line_number":1682,"context_line":"            self._session._wait_for_task(reconfig_task)"},{"line_number":1683,"context_line":"        except Exception as e:"},{"line_number":1684,"context_line":"            LOG.error(_(\u0027Attaching network adapter failed. Exception: %s\u0027),"},{"line_number":1685,"context_line":"                      e, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FfGc%3D","line":1682,"updated":"2014-04-14 09:49:30.000000000","message":"Feels there should be some function in session that encapsulates the call to \"ReconfigVM_Task\" and makes it into a blocking call, so this is much easier to read. In the meantime, please make this a separate function.\n\nYou should then be easily be able to test this with mock.","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c91c74c56e3100f5ec0e90ba1e1bed87de768a71","unresolved":false,"context_lines":[{"line_number":1679,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"},{"line_number":1680,"context_line":"                                        spec\u003dnetwork_attach_config_spec)"},{"line_number":1681,"context_line":"        try:"},{"line_number":1682,"context_line":"            self._session._wait_for_task(reconfig_task)"},{"line_number":1683,"context_line":"        except Exception as e:"},{"line_number":1684,"context_line":"            LOG.error(_(\u0027Attaching network adapter failed. Exception: %s\u0027),"},{"line_number":1685,"context_line":"                      e, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FUsE%3D","line":1682,"in_reply_to":"AAAAW3%2F%2FfGc%3D","updated":"2014-04-15 11:19:29.000000000","message":"Done\nThis is tested in the current tests","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"16e992950bf8a6b579304df8fbf54afe0e858bd5","unresolved":false,"context_lines":[{"line_number":1715,"context_line":"                    \"VM\") % vif[\u0027address\u0027]"},{"line_number":1716,"context_line":"            raise exception.NotFound(msg)"},{"line_number":1717,"context_line":""},{"line_number":1718,"context_line":"        instance_uuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1719,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1720,"context_line":"        network_detach_config_spec \u003d vm_util.get_network_detach_config_spec("},{"line_number":1721,"context_line":"                                    client_factory, device, port_index)"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FfEY%3D","line":1718,"updated":"2014-04-14 09:49:30.000000000","message":"don\u0027e see this being used.","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c91c74c56e3100f5ec0e90ba1e1bed87de768a71","unresolved":false,"context_lines":[{"line_number":1715,"context_line":"                    \"VM\") % vif[\u0027address\u0027]"},{"line_number":1716,"context_line":"            raise exception.NotFound(msg)"},{"line_number":1717,"context_line":""},{"line_number":1718,"context_line":"        instance_uuid \u003d instance[\u0027uuid\u0027]"},{"line_number":1719,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1720,"context_line":"        network_detach_config_spec \u003d vm_util.get_network_detach_config_spec("},{"line_number":1721,"context_line":"                                    client_factory, device, port_index)"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAAW3%2F%2FUyk%3D","line":1718,"in_reply_to":"AAAAW3%2F%2FfEY%3D","updated":"2014-04-15 11:19:29.000000000","message":"Done","commit_id":"9df6cdb4a96866e028eebdbc122d817d54475427"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"8694ed79f4a11084e70a12804ac41fbaa8852336","unresolved":false,"context_lines":[{"line_number":1614,"context_line":"                break"},{"line_number":1615,"context_line":"        return lst_vm_names"},{"line_number":1616,"context_line":""},{"line_number":1617,"context_line":"    def _reconfigure_interface(self, vm_ref, config_spec):"},{"line_number":1618,"context_line":"        reconfig_task \u003d self._session._call_method("},{"line_number":1619,"context_line":"                                        self._session._get_vim(),"},{"line_number":1620,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXX%2F%2FwS0%3D","line":1617,"updated":"2014-04-28 09:35:58.000000000","message":"rename this method, it has nothing to do with interfaces\n\nyou can also move it to vm_util.py","commit_id":"0f66b15b83ed437a67d9a4b915a5de815dbbc269"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4aab9302dac4995f50cac6b8d30c658fe8b11db8","unresolved":false,"context_lines":[{"line_number":1614,"context_line":"                break"},{"line_number":1615,"context_line":"        return lst_vm_names"},{"line_number":1616,"context_line":""},{"line_number":1617,"context_line":"    def _reconfigure_interface(self, vm_ref, config_spec):"},{"line_number":1618,"context_line":"        reconfig_task \u003d self._session._call_method("},{"line_number":1619,"context_line":"                                        self._session._get_vim(),"},{"line_number":1620,"context_line":"                                        \"ReconfigVM_Task\", vm_ref,"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXX%2F%2FvQw%3D","line":1617,"in_reply_to":"AAAAXX%2F%2FwS0%3D","updated":"2014-04-28 11:03:03.000000000","message":"please see https://review.openstack.org/90689","commit_id":"0f66b15b83ed437a67d9a4b915a5de815dbbc269"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"8694ed79f4a11084e70a12804ac41fbaa8852336","unresolved":false,"context_lines":[{"line_number":1625,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":1626,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1627,"context_line":"                                   network_model.VIF_MODEL_E1000)"},{"line_number":1628,"context_line":"        vif_model \u003d vm_util.convert_vif_model(vif_model)"},{"line_number":1629,"context_line":"        vif_info \u003d vmwarevif.get_vif_dict(self._session, self._cluster,"},{"line_number":1630,"context_line":"                                          vif_model, utils.is_neutron(), vif)"},{"line_number":1631,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXX%2F%2FwP0%3D","line":1628,"updated":"2014-04-28 09:35:58.000000000","message":"why convert_vif_model() is not in vif.py?","commit_id":"0f66b15b83ed437a67d9a4b915a5de815dbbc269"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"4aab9302dac4995f50cac6b8d30c658fe8b11db8","unresolved":false,"context_lines":[{"line_number":1625,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":1626,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1627,"context_line":"                                   network_model.VIF_MODEL_E1000)"},{"line_number":1628,"context_line":"        vif_model \u003d vm_util.convert_vif_model(vif_model)"},{"line_number":1629,"context_line":"        vif_info \u003d vmwarevif.get_vif_dict(self._session, self._cluster,"},{"line_number":1630,"context_line":"                                          vif_model, utils.is_neutron(), vif)"},{"line_number":1631,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAAXX%2F%2Fvj4%3D","line":1628,"in_reply_to":"AAAAXX%2F%2FwP0%3D","updated":"2014-04-28 11:03:03.000000000","message":"sadly that cannot be done due to circular imports.","commit_id":"0f66b15b83ed437a67d9a4b915a5de815dbbc269"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3113d56378a889dc77ce3a4702984d2cf90b8a48","unresolved":false,"context_lines":[{"line_number":1612,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1613,"context_line":"        network_attach_config_spec \u003d vm_util.get_network_attach_config_spec("},{"line_number":1614,"context_line":"                                    client_factory, vif_info, port_index)"},{"line_number":1615,"context_line":"        LOG.debug(_(\"Reconfiguring VM to attach interface\"), instance\u003dinstance)"},{"line_number":1616,"context_line":"        try:"},{"line_number":1617,"context_line":"            vm_util.reconfigure_vm(self._session, vm_ref, network_attach_config_spec)"},{"line_number":1618,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":30,"id":"bad4c104_a82b0681","line":1615,"updated":"2014-04-29 20:35:41.000000000","message":"No need for i18n on DEBUG messages. Here and throughout...","commit_id":"5534dc75abdee5f8231e04a62e9227cf95061490"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1ae51f3cde41a3d1b6c4fae4db797fc32b47cbc4","unresolved":false,"context_lines":[{"line_number":1612,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1613,"context_line":"        network_attach_config_spec \u003d vm_util.get_network_attach_config_spec("},{"line_number":1614,"context_line":"                                    client_factory, vif_info, port_index)"},{"line_number":1615,"context_line":"        LOG.debug(_(\"Reconfiguring VM to attach interface\"), instance\u003dinstance)"},{"line_number":1616,"context_line":"        try:"},{"line_number":1617,"context_line":"            vm_util.reconfigure_vm(self._session, vm_ref, network_attach_config_spec)"},{"line_number":1618,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":30,"id":"9ad9bd40_f2f509cc","line":1615,"in_reply_to":"bad4c104_a82b0681","updated":"2014-04-30 10:26:19.000000000","message":"Done","commit_id":"5534dc75abdee5f8231e04a62e9227cf95061490"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"602256ea2a173208a88a51135c047cd61d7dc291","unresolved":false,"context_lines":[{"line_number":1615,"context_line":"        LOG.debug(\"Reconfiguring VM to attach interface\", instance\u003dinstance)"},{"line_number":1616,"context_line":"        try:"},{"line_number":1617,"context_line":"            vm_util.reconfigure_vm(self._session, vm_ref, network_attach_config_spec)"},{"line_number":1618,"context_line":"        except Exception as e:"},{"line_number":1619,"context_line":"            LOG.error(_(\u0027Attaching network adapter failed. Exception: %s\u0027),"},{"line_number":1620,"context_line":"                      e, instance\u003dinstance)"},{"line_number":1621,"context_line":"            raise exception.InterfaceAttachFailed(instance)"}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_539f8d5f","line":1618,"updated":"2014-04-30 17:37:58.000000000","message":"I\u0027d like to see something more specific being caught here.","commit_id":"e7f9ac660ebb92aa13c7cdfec0fb6fefd53197c1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e1d5ecc8a9ec7afdef2e7dfaca2111ca5a7f30ed","unresolved":false,"context_lines":[{"line_number":1615,"context_line":"        LOG.debug(\"Reconfiguring VM to attach interface\", instance\u003dinstance)"},{"line_number":1616,"context_line":"        try:"},{"line_number":1617,"context_line":"            vm_util.reconfigure_vm(self._session, vm_ref, network_attach_config_spec)"},{"line_number":1618,"context_line":"        except Exception as e:"},{"line_number":1619,"context_line":"            LOG.error(_(\u0027Attaching network adapter failed. Exception: %s\u0027),"},{"line_number":1620,"context_line":"                      e, instance\u003dinstance)"},{"line_number":1621,"context_line":"            raise exception.InterfaceAttachFailed(instance)"}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_0d0759cb","line":1618,"in_reply_to":"9ad9bd40_539f8d5f","updated":"2014-05-04 12:46:38.000000000","message":"I think that this could be pretty difficult. The reason is that the reconfigure task can throw a number of different exceptions, for example: ConcurrentAccess, DuplicateName, FileFault, InsufficientResourcesFault, InvalidName, InvalidState, RuntimeFault, TaskInProgress, TooManyDevices, VmConfigFault.\nIn addition to this additional exceptions may be added by the backend.\nThe purpose here is to elevate InterfaceAttachFailed so that the euser will not get an internal server error.\nWhat do you suggest here?","commit_id":"e7f9ac660ebb92aa13c7cdfec0fb6fefd53197c1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"602256ea2a173208a88a51135c047cd61d7dc291","unresolved":false,"context_lines":[{"line_number":1619,"context_line":"            LOG.error(_(\u0027Attaching network adapter failed. Exception: %s\u0027),"},{"line_number":1620,"context_line":"                      e, instance\u003dinstance)"},{"line_number":1621,"context_line":"            raise exception.InterfaceAttachFailed(instance)"},{"line_number":1622,"context_line":"        LOG.debug(\"Reconfigured VM to attach interface\", instance\u003dinstance)"},{"line_number":1623,"context_line":""},{"line_number":1624,"context_line":"    def detach_interface(self, instance, vif):"},{"line_number":1625,"context_line":"        \"\"\"Detach an interface from the instance.\"\"\""}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_136d0533","line":1622,"updated":"2014-04-30 17:37:58.000000000","message":"Where is the call over to Neutron to do the plugging? I ask because it would be nice to see this use the event mechanism to make sure it succeeds.","commit_id":"e7f9ac660ebb92aa13c7cdfec0fb6fefd53197c1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e1d5ecc8a9ec7afdef2e7dfaca2111ca5a7f30ed","unresolved":false,"context_lines":[{"line_number":1619,"context_line":"            LOG.error(_(\u0027Attaching network adapter failed. Exception: %s\u0027),"},{"line_number":1620,"context_line":"                      e, instance\u003dinstance)"},{"line_number":1621,"context_line":"            raise exception.InterfaceAttachFailed(instance)"},{"line_number":1622,"context_line":"        LOG.debug(\"Reconfigured VM to attach interface\", instance\u003dinstance)"},{"line_number":1623,"context_line":""},{"line_number":1624,"context_line":"    def detach_interface(self, instance, vif):"},{"line_number":1625,"context_line":"        \"\"\"Detach an interface from the instance.\"\"\""}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_6d2b8530","line":1622,"in_reply_to":"9ad9bd40_136d0533","updated":"2014-05-04 12:46:38.000000000","message":"There is no call to Neutron to do the plug/unplug. The neutron service has the details for the port that is being used. The neutron service updates the NSX controller (previously NVP). On the ESX the config spec has the vif details - that is, a backing with the opaque details, which attaches the VM to the virtual network. There is no need for the events here.","commit_id":"e7f9ac660ebb92aa13c7cdfec0fb6fefd53197c1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"602256ea2a173208a88a51135c047cd61d7dc291","unresolved":false,"context_lines":[{"line_number":1625,"context_line":"        \"\"\"Detach an interface from the instance.\"\"\""},{"line_number":1626,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1627,"context_line":"        port_index \u003d vm_util.get_vm_detach_port_index(self._session, vm_ref,"},{"line_number":1628,"context_line":"                                                      vif[\u0027id\u0027])"},{"line_number":1629,"context_line":"        if port_index is None:"},{"line_number":1630,"context_line":"            msg \u003d _(\"No device with interface-id %s exists on VM\") % vif[\u0027id\u0027]"},{"line_number":1631,"context_line":"            raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_d382bdff","line":1628,"updated":"2014-04-30 17:37:58.000000000","message":"I think vif is passed in as an object now right?","commit_id":"e7f9ac660ebb92aa13c7cdfec0fb6fefd53197c1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e1d5ecc8a9ec7afdef2e7dfaca2111ca5a7f30ed","unresolved":false,"context_lines":[{"line_number":1625,"context_line":"        \"\"\"Detach an interface from the instance.\"\"\""},{"line_number":1626,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1627,"context_line":"        port_index \u003d vm_util.get_vm_detach_port_index(self._session, vm_ref,"},{"line_number":1628,"context_line":"                                                      vif[\u0027id\u0027])"},{"line_number":1629,"context_line":"        if port_index is None:"},{"line_number":1630,"context_line":"            msg \u003d _(\"No device with interface-id %s exists on VM\") % vif[\u0027id\u0027]"},{"line_number":1631,"context_line":"            raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":31,"id":"9ad9bd40_8de8c9e3","line":1628,"in_reply_to":"9ad9bd40_d382bdff","updated":"2014-05-04 12:46:38.000000000","message":"I don\u0027t think so - https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L4376","commit_id":"e7f9ac660ebb92aa13c7cdfec0fb6fefd53197c1"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"4c4629911a4c4de3927d66a4e6ceb693f83676b5","unresolved":false,"context_lines":[{"line_number":1476,"context_line":"        vif_info \u003d vmwarevif.get_vif_dict(self._session, self._cluster,"},{"line_number":1477,"context_line":"                                          vif_model, utils.is_neutron(), vif)"},{"line_number":1478,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1479,"context_line":"        port_index \u003d vm_util.get_attach_port_index(self._session, vm_ref)"},{"line_number":1480,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1481,"context_line":"        network_attach_config_spec \u003d vm_util.get_network_attach_config_spec("},{"line_number":1482,"context_line":"                                    client_factory, vif_info, port_index)"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_4312f158","line":1479,"updated":"2014-06-26 06:26:36.000000000","message":"there is a race condition between choosing the port_index and reconfiguring the vm; can we have problems because of this?","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c54dab339f8f5d146347589bdb506cd9ac4a2bbd","unresolved":false,"context_lines":[{"line_number":1476,"context_line":"        vif_info \u003d vmwarevif.get_vif_dict(self._session, self._cluster,"},{"line_number":1477,"context_line":"                                          vif_model, utils.is_neutron(), vif)"},{"line_number":1478,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1479,"context_line":"        port_index \u003d vm_util.get_attach_port_index(self._session, vm_ref)"},{"line_number":1480,"context_line":"        client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1481,"context_line":"        network_attach_config_spec \u003d vm_util.get_network_attach_config_spec("},{"line_number":1482,"context_line":"                                    client_factory, vif_info, port_index)"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_d1fec204","line":1479,"in_reply_to":"1ae5cdf2_4312f158","updated":"2014-06-26 10:05:55.000000000","message":"good catch","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"4c4629911a4c4de3927d66a4e6ceb693f83676b5","unresolved":false,"context_lines":[{"line_number":1493,"context_line":"    def detach_interface(self, instance, vif):"},{"line_number":1494,"context_line":"        \"\"\"Detach an interface from the instance.\"\"\""},{"line_number":1495,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1496,"context_line":"        port_index \u003d vm_util.get_vm_detach_port_index(self._session, vm_ref,"},{"line_number":1497,"context_line":"                                                      vif[\u0027id\u0027])"},{"line_number":1498,"context_line":"        if port_index is None:"},{"line_number":1499,"context_line":"            msg \u003d _(\"No device with interface-id %s exists on VM\") % vif[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_a315753e","line":1496,"updated":"2014-06-26 06:26:36.000000000","message":"same issue here","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c54dab339f8f5d146347589bdb506cd9ac4a2bbd","unresolved":false,"context_lines":[{"line_number":1493,"context_line":"    def detach_interface(self, instance, vif):"},{"line_number":1494,"context_line":"        \"\"\"Detach an interface from the instance.\"\"\""},{"line_number":1495,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1496,"context_line":"        port_index \u003d vm_util.get_vm_detach_port_index(self._session, vm_ref,"},{"line_number":1497,"context_line":"                                                      vif[\u0027id\u0027])"},{"line_number":1498,"context_line":"        if port_index is None:"},{"line_number":1499,"context_line":"            msg \u003d _(\"No device with interface-id %s exists on VM\") % vif[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":37,"id":"1ae5cdf2_f103be0a","line":1496,"in_reply_to":"1ae5cdf2_a315753e","updated":"2014-06-26 10:05:55.000000000","message":"Done","commit_id":"d307b9fa99b7f211857a0ab8fb9f4ac4dd4cefde"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":1461,"context_line":"    def attach_interface(self, instance, image_meta, vif):"},{"line_number":1462,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":1463,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1464,"context_line":"                                   network_model.VIF_MODEL_E1000)"},{"line_number":1465,"context_line":"        vif_model \u003d vm_util.convert_vif_model(vif_model)"},{"line_number":1466,"context_line":"        vif_info \u003d vmwarevif.get_vif_dict(self._session, self._cluster,"},{"line_number":1467,"context_line":"                                          vif_model, utils.is_neutron(), vif)"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_27753298","line":1464,"updated":"2014-07-02 15:04:21.000000000","message":"This should probably use the refactored VMwareImage class, which also defaults these things. That would avoid defaulting it in multiple places, which will inevitably lead to inconsistencies.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"dd0ba19890203ba5e58877788530bb82bf34d26a","unresolved":false,"context_lines":[{"line_number":1461,"context_line":"    def attach_interface(self, instance, image_meta, vif):"},{"line_number":1462,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":1463,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1464,"context_line":"                                   network_model.VIF_MODEL_E1000)"},{"line_number":1465,"context_line":"        vif_model \u003d vm_util.convert_vif_model(vif_model)"},{"line_number":1466,"context_line":"        vif_info \u003d vmwarevif.get_vif_dict(self._session, self._cluster,"},{"line_number":1467,"context_line":"                                          vif_model, utils.is_neutron(), vif)"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_712fba88","line":1464,"in_reply_to":"baada198_27753298","updated":"2014-07-03 11:52:23.000000000","message":"The image stuff should use the deafult network model and not vice versa","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1469,"context_line":"        with lockutils.lock(instance[\u0027uuid\u0027],"},{"line_number":1470,"context_line":"                            lock_file_prefix\u003d\u0027nova-vmware-hot-plug\u0027,"},{"line_number":1471,"context_line":"                            external\u003dTrue):"},{"line_number":1472,"context_line":"            port_index \u003d vm_util.get_attach_port_index(self._session, vm_ref)"},{"line_number":1473,"context_line":"            client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1474,"context_line":"            attach_config_spec \u003d vm_util.get_network_attach_config_spec("}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_995bc286","line":1471,"updated":"2014-07-02 15:04:21.000000000","message":"Don\u0027t think this lock needs to be external. However, you should comment it: the lock is presumably protecting the critical section between get_attach_port_index() and reconfigure_vm().\n\nSame for lock below.","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"dd0ba19890203ba5e58877788530bb82bf34d26a","unresolved":false,"context_lines":[{"line_number":1468,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1469,"context_line":"        with lockutils.lock(instance[\u0027uuid\u0027],"},{"line_number":1470,"context_line":"                            lock_file_prefix\u003d\u0027nova-vmware-hot-plug\u0027,"},{"line_number":1471,"context_line":"                            external\u003dTrue):"},{"line_number":1472,"context_line":"            port_index \u003d vm_util.get_attach_port_index(self._session, vm_ref)"},{"line_number":1473,"context_line":"            client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1474,"context_line":"            attach_config_spec \u003d vm_util.get_network_attach_config_spec("}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_d1db264d","line":1471,"in_reply_to":"baada198_995bc286","updated":"2014-07-03 11:52:23.000000000","message":"Done","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":1489,"context_line":"    def detach_interface(self, instance, vif):"},{"line_number":1490,"context_line":"        \"\"\"Detach an interface from the instance.\"\"\""},{"line_number":1491,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1492,"context_line":"        with lockutils.lock(instance[\u0027uuid\u0027],"},{"line_number":1493,"context_line":"                            lock_file_prefix\u003d\u0027nova-vmware-hot-plug\u0027,"},{"line_number":1494,"context_line":"                            external\u003dTrue):"},{"line_number":1495,"context_line":"            port_index \u003d vm_util.get_vm_detach_port_index(self._session,"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_4c35edf5","line":1492,"updated":"2014-07-02 15:04:21.000000000","message":"Object interface (and throughout).","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"dd0ba19890203ba5e58877788530bb82bf34d26a","unresolved":false,"context_lines":[{"line_number":1489,"context_line":"    def detach_interface(self, instance, vif):"},{"line_number":1490,"context_line":"        \"\"\"Detach an interface from the instance.\"\"\""},{"line_number":1491,"context_line":"        vm_ref \u003d vm_util.get_vm_ref(self._session, instance)"},{"line_number":1492,"context_line":"        with lockutils.lock(instance[\u0027uuid\u0027],"},{"line_number":1493,"context_line":"                            lock_file_prefix\u003d\u0027nova-vmware-hot-plug\u0027,"},{"line_number":1494,"context_line":"                            external\u003dTrue):"},{"line_number":1495,"context_line":"            port_index \u003d vm_util.get_vm_detach_port_index(self._session,"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_b1a8728e","line":1492,"in_reply_to":"baada198_4c35edf5","updated":"2014-07-03 11:52:23.000000000","message":"Done","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":1497,"context_line":"                                                          vif[\u0027id\u0027])"},{"line_number":1498,"context_line":"            if port_index is None:"},{"line_number":1499,"context_line":"                msg \u003d _(\"No device with interface-id %s exists on \""},{"line_number":1500,"context_line":"                        \"VM\") % vif[\u0027id\u0027]"},{"line_number":1501,"context_line":"                raise exception.NotFound(msg)"},{"line_number":1502,"context_line":""},{"line_number":1503,"context_line":"            hardware_devices \u003d self._session._call_method(vim_util,"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_9c21f0a1","line":1500,"updated":"2014-07-02 15:04:21.000000000","message":"nit: Is wrapping required here?","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"dd0ba19890203ba5e58877788530bb82bf34d26a","unresolved":false,"context_lines":[{"line_number":1497,"context_line":"                                                          vif[\u0027id\u0027])"},{"line_number":1498,"context_line":"            if port_index is None:"},{"line_number":1499,"context_line":"                msg \u003d _(\"No device with interface-id %s exists on \""},{"line_number":1500,"context_line":"                        \"VM\") % vif[\u0027id\u0027]"},{"line_number":1501,"context_line":"                raise exception.NotFound(msg)"},{"line_number":1502,"context_line":""},{"line_number":1503,"context_line":"            hardware_devices \u003d self._session._call_method(vim_util,"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_31946242","line":1500,"in_reply_to":"baada198_9c21f0a1","updated":"2014-07-03 11:52:23.000000000","message":"no","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"616400a98f57b8e8a7ce137701f71dbad0cf0e51","unresolved":false,"context_lines":[{"line_number":1505,"context_line":"                            \"VirtualMachine\", \"config.hardware.device\")"},{"line_number":1506,"context_line":"            device \u003d vmwarevif.get_network_device(hardware_devices,"},{"line_number":1507,"context_line":"                                                  vif[\u0027address\u0027])"},{"line_number":1508,"context_line":"            if not device:"},{"line_number":1509,"context_line":"                msg \u003d _(\"No device with MAC address %s exists on the \""},{"line_number":1510,"context_line":"                        \"VM\") % vif[\u0027address\u0027]"},{"line_number":1511,"context_line":"                raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_efd87081","line":1508,"updated":"2014-07-02 15:04:21.000000000","message":"if device is None","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"dd0ba19890203ba5e58877788530bb82bf34d26a","unresolved":false,"context_lines":[{"line_number":1505,"context_line":"                            \"VirtualMachine\", \"config.hardware.device\")"},{"line_number":1506,"context_line":"            device \u003d vmwarevif.get_network_device(hardware_devices,"},{"line_number":1507,"context_line":"                                                  vif[\u0027address\u0027])"},{"line_number":1508,"context_line":"            if not device:"},{"line_number":1509,"context_line":"                msg \u003d _(\"No device with MAC address %s exists on the \""},{"line_number":1510,"context_line":"                        \"VM\") % vif[\u0027address\u0027]"},{"line_number":1511,"context_line":"                raise exception.NotFound(msg)"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_719a5a6f","line":1508,"in_reply_to":"baada198_efd87081","updated":"2014-07-03 11:52:23.000000000","message":"Done","commit_id":"cb6bbbf6324f90cd8a8271c3f6aba562485fbe6e"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"482870a5e786f18a934d3387a2e157f5aad0743a","unresolved":false,"context_lines":[{"line_number":1461,"context_line":"    def attach_interface(self, instance, image_meta, vif):"},{"line_number":1462,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":1463,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1464,"context_line":"                                   network_model.VIF_MODEL_E1000)"},{"line_number":1465,"context_line":"        vif_model \u003d vm_util.convert_vif_model(vif_model)"},{"line_number":1466,"context_line":"        vif_info \u003d vmwarevif.get_vif_dict(self._session, self._cluster,"},{"line_number":1467,"context_line":"                                          vif_model, utils.is_neutron(), vif)"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_6818a81e","line":1464,"updated":"2014-07-03 15:19:07.000000000","message":"As discussed on IRC, we\u0027re going to move the definition of the default into a common constants module which will be used both here and by vmware_images.py. This will eventually be consistent.","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"9bb639c6ed170f4eb7b30a950fbd0e24a1b6bc06","unresolved":false,"context_lines":[{"line_number":1461,"context_line":"    def attach_interface(self, instance, image_meta, vif):"},{"line_number":1462,"context_line":"        \"\"\"Attach an interface to the instance.\"\"\""},{"line_number":1463,"context_line":"        vif_model \u003d image_meta.get(\"hw_vif_model\","},{"line_number":1464,"context_line":"                                   network_model.VIF_MODEL_E1000)"},{"line_number":1465,"context_line":"        vif_model \u003d vm_util.convert_vif_model(vif_model)"},{"line_number":1466,"context_line":"        vif_info \u003d vmwarevif.get_vif_dict(self._session, self._cluster,"},{"line_number":1467,"context_line":"                                          vif_model, utils.is_neutron(), vif)"}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_94750afc","line":1464,"in_reply_to":"baada198_6818a81e","updated":"2014-07-03 19:08:31.000000000","message":"Done","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"482870a5e786f18a934d3387a2e157f5aad0743a","unresolved":false,"context_lines":[{"line_number":1469,"context_line":"        # Ensure that there is not a race with a reconfigure"},{"line_number":1470,"context_line":"        with lockutils.lock(instance.uuid,"},{"line_number":1471,"context_line":"                            lock_file_prefix\u003d\u0027nova-vmware-hot-plug\u0027,"},{"line_number":1472,"context_line":"                            external\u003dTrue):"},{"line_number":1473,"context_line":"            port_index \u003d vm_util.get_attach_port_index(self._session, vm_ref)"},{"line_number":1474,"context_line":"            client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1475,"context_line":"            attach_config_spec \u003d vm_util.get_network_attach_config_spec("}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_486cc435","line":1472,"updated":"2014-07-03 15:19:07.000000000","message":"The lock still doesn\u0027t need to be external. That\u0027s for when you\u0027re coordinating with an external process. The only thing which is ever going to use this lock is Nova.\n\nI\u0027d also prefer that the comment mention both the read and write end of the lock. i.e.\n\nLock ensures that port returned by vm_util.get_attach_port_index() remains valid when we pass it to reconfigure_vm.\n\nSame below.","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"9bb639c6ed170f4eb7b30a950fbd0e24a1b6bc06","unresolved":false,"context_lines":[{"line_number":1469,"context_line":"        # Ensure that there is not a race with a reconfigure"},{"line_number":1470,"context_line":"        with lockutils.lock(instance.uuid,"},{"line_number":1471,"context_line":"                            lock_file_prefix\u003d\u0027nova-vmware-hot-plug\u0027,"},{"line_number":1472,"context_line":"                            external\u003dTrue):"},{"line_number":1473,"context_line":"            port_index \u003d vm_util.get_attach_port_index(self._session, vm_ref)"},{"line_number":1474,"context_line":"            client_factory \u003d self._session._get_vim().client.factory"},{"line_number":1475,"context_line":"            attach_config_spec \u003d vm_util.get_network_attach_config_spec("}],"source_content_type":"text/x-python","patch_set":42,"id":"baada198_3410bea7","line":1472,"in_reply_to":"baada198_486cc435","updated":"2014-07-03 19:08:31.000000000","message":"Done","commit_id":"213fe989c2ec6a5d9fecdfb1e4871a090094a28d"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":219,"context_line":""},{"line_number":220,"context_line":"            image_size, image_properties \u003d _image_info"},{"line_number":221,"context_line":"            vmdk_file_size_in_kb \u003d int(image_size) / 1024"},{"line_number":222,"context_line":"            os_type \u003d image_properties.get(\"vmware_ostype\", \"otherGuest\")"},{"line_number":223,"context_line":"            adapter_type \u003d image_properties.get(\"vmware_adaptertype\","},{"line_number":224,"context_line":"                                                \"lsiLogic\")"},{"line_number":225,"context_line":"            disk_type \u003d image_properties.get(\"vmware_disktype\","}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_ea21e54d","line":222,"updated":"2014-07-04 14:42:10.000000000","message":"DEFAULT_OS_TYPE","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":219,"context_line":""},{"line_number":220,"context_line":"            image_size, image_properties \u003d _image_info"},{"line_number":221,"context_line":"            vmdk_file_size_in_kb \u003d int(image_size) / 1024"},{"line_number":222,"context_line":"            os_type \u003d image_properties.get(\"vmware_ostype\", \"otherGuest\")"},{"line_number":223,"context_line":"            adapter_type \u003d image_properties.get(\"vmware_adaptertype\","},{"line_number":224,"context_line":"                                                \"lsiLogic\")"},{"line_number":225,"context_line":"            disk_type \u003d image_properties.get(\"vmware_disktype\","}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_0540ca32","line":222,"in_reply_to":"baada198_ea21e54d","updated":"2014-07-04 15:29:57.000000000","message":"Done","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":221,"context_line":"            vmdk_file_size_in_kb \u003d int(image_size) / 1024"},{"line_number":222,"context_line":"            os_type \u003d image_properties.get(\"vmware_ostype\", \"otherGuest\")"},{"line_number":223,"context_line":"            adapter_type \u003d image_properties.get(\"vmware_adaptertype\","},{"line_number":224,"context_line":"                                                \"lsiLogic\")"},{"line_number":225,"context_line":"            disk_type \u003d image_properties.get(\"vmware_disktype\","},{"line_number":226,"context_line":"                                             \"preallocated\")"},{"line_number":227,"context_line":"            # Get the network card type from the image properties."}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_8a3309aa","line":224,"updated":"2014-07-04 14:42:10.000000000","message":"DEFAULT_ADAPTER_TYPE","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":221,"context_line":"            vmdk_file_size_in_kb \u003d int(image_size) / 1024"},{"line_number":222,"context_line":"            os_type \u003d image_properties.get(\"vmware_ostype\", \"otherGuest\")"},{"line_number":223,"context_line":"            adapter_type \u003d image_properties.get(\"vmware_adaptertype\","},{"line_number":224,"context_line":"                                                \"lsiLogic\")"},{"line_number":225,"context_line":"            disk_type \u003d image_properties.get(\"vmware_disktype\","},{"line_number":226,"context_line":"                                             \"preallocated\")"},{"line_number":227,"context_line":"            # Get the network card type from the image properties."}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_455d6214","line":224,"in_reply_to":"baada198_8a3309aa","updated":"2014-07-04 15:29:57.000000000","message":"Done","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            adapter_type \u003d image_properties.get(\"vmware_adaptertype\","},{"line_number":224,"context_line":"                                                \"lsiLogic\")"},{"line_number":225,"context_line":"            disk_type \u003d image_properties.get(\"vmware_disktype\","},{"line_number":226,"context_line":"                                             \"preallocated\")"},{"line_number":227,"context_line":"            # Get the network card type from the image properties."},{"line_number":228,"context_line":"            vif_model \u003d image_properties.get(\"hw_vif_model\","},{"line_number":229,"context_line":"                                             constants.DEFAULT_VIF_MODEL)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_ca298138","line":226,"updated":"2014-07-04 14:42:10.000000000","message":"DEFAULT_DISK_TYPE","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":223,"context_line":"            adapter_type \u003d image_properties.get(\"vmware_adaptertype\","},{"line_number":224,"context_line":"                                                \"lsiLogic\")"},{"line_number":225,"context_line":"            disk_type \u003d image_properties.get(\"vmware_disktype\","},{"line_number":226,"context_line":"                                             \"preallocated\")"},{"line_number":227,"context_line":"            # Get the network card type from the image properties."},{"line_number":228,"context_line":"            vif_model \u003d image_properties.get(\"hw_vif_model\","},{"line_number":229,"context_line":"                                             constants.DEFAULT_VIF_MODEL)"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_05ae0ae6","line":226,"in_reply_to":"baada198_ca298138","updated":"2014-07-04 15:29:57.000000000","message":"Done","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"087cd1939441bf825ad1f7d31c9cf78b32000704","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                                             \"preallocated\")"},{"line_number":227,"context_line":"            # Get the network card type from the image properties."},{"line_number":228,"context_line":"            vif_model \u003d image_properties.get(\"hw_vif_model\","},{"line_number":229,"context_line":"                                             constants.DEFAULT_VIF_MODEL)"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"            # Fetch the image_linked_clone data here. It is retrieved"},{"line_number":232,"context_line":"            # with the above network based API call. To retrieve it"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_eae805e4","line":229,"updated":"2014-07-04 14:42:10.000000000","message":"Cool. We\u0027ll patch vmware_images.py accordingly at some point to use these constants.","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f3a04d91971195d323dc29b369fd0de61abb0b56","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                                             \"preallocated\")"},{"line_number":227,"context_line":"            # Get the network card type from the image properties."},{"line_number":228,"context_line":"            vif_model \u003d image_properties.get(\"hw_vif_model\","},{"line_number":229,"context_line":"                                             constants.DEFAULT_VIF_MODEL)"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"            # Fetch the image_linked_clone data here. It is retrieved"},{"line_number":232,"context_line":"            # with the above network based API call. To retrieve it"}],"source_content_type":"text/x-python","patch_set":43,"id":"baada198_6565061d","line":229,"in_reply_to":"baada198_eae805e4","updated":"2014-07-04 15:29:57.000000000","message":"please see https://review.openstack.org/104919 - this will be rebased on that","commit_id":"5b6a45bed334cf4820d9bfc38a0897db42f13e7c"}]}
