From 5b804e51413adfe15a32eb40e904a02e5a1166f9 Mon Sep 17 00:00:00 2001 From: Yaguang Tang Date: Tue, 4 Jun 2013 13:56:32 +0800 Subject: Remove unused method in VMware driver. list_interface method in VMware driver isn't used any where. Fix bug #1187251 Change-Id: Idc7cee5ab1d0c5b4ebf57ca28511e3b7b4a85240 --- nova/tests/virt/vmwareapi/test_vmwareapi.py | 6 ------ nova/virt/vmwareapi/driver.py | 10 ---------- nova/virt/vmwareapi/vmops.py | 25 ------------------------- 3 files changed, 41 deletions(-) diff --git a/nova/tests/virt/vmwareapi/test_vmwareapi.py b/nova/tests/virt/vmwareapi/test_vmwareapi.py index 2691857fe..ab7aa083b 100644 --- a/nova/tests/virt/vmwareapi/test_vmwareapi.py +++ b/nova/tests/virt/vmwareapi/test_vmwareapi.py @@ -205,12 +205,6 @@ class VMwareAPIVMTestCase(test.TestCase): instances = self.conn.list_instances() self.assertEquals(len(instances), 1) - def test_list_interfaces(self): - self._create_vm() - interfaces = self.conn.list_interfaces(1) - self.assertEquals(len(interfaces), 1) - self.assertEquals(interfaces[0], 4000) - def test_spawn(self): self._create_vm() info = self.conn.get_info({'name': 1}) diff --git a/nova/virt/vmwareapi/driver.py b/nova/virt/vmwareapi/driver.py index 916913187..1cdaee2f5 100755 --- a/nova/virt/vmwareapi/driver.py +++ b/nova/virt/vmwareapi/driver.py @@ -329,16 +329,6 @@ class VMwareESXDriver(driver.ComputeDriver): """Unplug VIFs from networks.""" self._vmops.unplug_vifs(instance, network_info) - def list_interfaces(self, instance_name): - """ - Return the IDs of all the virtual network interfaces attached to the - specified instance, as a list. These IDs are opaque to the caller - (they are only useful for giving back to this layer as a parameter to - interface_stats). These IDs only need to be unique for a given - instance. - """ - return self._vmops.list_interfaces(instance_name) - class VMwareVCDriver(VMwareESXDriver): """The ESX host connection object.""" diff --git a/nova/virt/vmwareapi/vmops.py b/nova/virt/vmwareapi/vmops.py index 538b498b6..fea8c9135 100644 --- a/nova/virt/vmwareapi/vmops.py +++ b/nova/virt/vmwareapi/vmops.py @@ -1323,28 +1323,3 @@ class VMwareVMOps(object): def unplug_vifs(self, instance, network_info): """Unplug VIFs from networks.""" pass - - def list_interfaces(self, instance_name): - """ - Return the IDs of all the virtual network interfaces attached to the - specified instance, as a list. These IDs are opaque to the caller - (they are only useful for giving back to this layer as a parameter to - interface_stats). These IDs only need to be unique for a given - instance. - """ - vm_ref = vm_util.get_vm_ref_from_name(self._session, instance_name) - if vm_ref is None: - raise exception.InstanceNotFound(instance_id=instance_name) - - interfaces = [] - # Get the virtual network interfaces attached to the VM - hardware_devices = self._session._call_method(vim_util, - "get_dynamic_property", vm_ref, - "VirtualMachine", "config.hardware.device") - - for device in hardware_devices: - if device.__class__.__name__ in ["VirtualE1000", "VirtualE1000e", - "VirtualPCNet32", "VirtualVmxnet"]: - interfaces.append(device.key) - - return interfaces -- cgit