diff options
| author | Dan Prince <dprince@redhat.com> | 2012-08-06 12:09:23 -0400 |
|---|---|---|
| committer | Dan Prince <dprince@redhat.com> | 2012-08-06 12:09:23 -0400 |
| commit | 84e069b8d637c08f0434038ff2a2b272254e4a0e (patch) | |
| tree | 15a965a5d88b07b68d262a6f6beb5e156c0249a2 /nova | |
| parent | db572f6b4b8f1f2084139b7168356c61e54b4317 (diff) | |
Remove unused InstanceInfo class.
We no longer use InstanceInfo.
Also removes some unused _map_to_instance_info functions in
various virt drivers.
Change-Id: I02ead10e43426b9ad051970e9e78e970de5b1ac1
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/baremetal/driver.py | 7 | ||||
| -rw-r--r-- | nova/virt/driver.py | 7 | ||||
| -rw-r--r-- | nova/virt/fake.py | 5 | ||||
| -rw-r--r-- | nova/virt/libvirt/driver.py | 18 |
4 files changed, 0 insertions, 37 deletions
diff --git a/nova/virt/baremetal/driver.py b/nova/virt/baremetal/driver.py index 45cd40b75..62fffc25b 100644 --- a/nova/virt/baremetal/driver.py +++ b/nova/virt/baremetal/driver.py @@ -105,13 +105,6 @@ class BareMetalDriver(driver.ComputeDriver): def list_instances(self): return self._conn.list_domains() - def _map_to_instance_info(self, domain_name): - """Gets info from a virsh domain object into an InstanceInfo""" - _domain_info = self._conn.get_domain_info(domain_name) - state, _max_mem, _mem, _num_cpu, _cpu_time = _domain_info - name = domain_name - return driver.InstanceInfo(name, state) - def destroy(self, instance, network_info, block_device_info=None, cleanup=True): while True: diff --git a/nova/virt/driver.py b/nova/virt/driver.py index 182e16b4a..eab0c1c1d 100644 --- a/nova/virt/driver.py +++ b/nova/virt/driver.py @@ -31,13 +31,6 @@ LOG = logging.getLogger(__name__) FLAGS = flags.FLAGS -class InstanceInfo(object): - def __init__(self, name, state): - self.name = name - assert state in power_state.valid_states(), "Bad state: %s" % state - self.state = state - - def block_device_info_get_root(block_device_info): block_device_info = block_device_info or {} return block_device_info.get('root_device_name') diff --git a/nova/virt/fake.py b/nova/virt/fake.py index fcb46bca7..d775cf6eb 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -71,11 +71,6 @@ class FakeDriver(driver.ComputeDriver): def list_instances(self): return self.instances.keys() - def _map_to_instance_info(self, instance): - instance = utils.check_isinstance(instance, FakeInstance) - info = driver.InstanceInfo(instance.name, instance.state) - return info - def plug_vifs(self, instance, network_info): """Plug VIFs into networks.""" pass diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index af230c59e..d6f8a7831 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -421,24 +421,6 @@ class LibvirtDriver(driver.ComputeDriver): pass return names - @staticmethod - def _map_to_instance_info(domain): - """Gets info from a virsh domain object into an InstanceInfo""" - - # domain.info() returns a list of: - # state: one of the state values (virDomainState) - # maxMemory: the maximum memory used by the domain - # memory: the current amount of memory used by the domain - # nbVirtCPU: the number of virtual CPU - # puTime: the time used by the domain in nanoseconds - - (state, _max_mem, _mem, _num_cpu, _cpu_time) = domain.info() - state = LIBVIRT_POWER_STATE[state] - - name = domain.name() - - return driver.InstanceInfo(name, state) - def plug_vifs(self, instance, network_info): """Plug VIFs into networks.""" for (network, mapping) in network_info: |
