"client" parameter is not used anywhere
"client" parameter is not used anywhere in https://github.com/openstack/nova-dpm/blob/master /nova_dpm/virt/dpm/vm.py#L109 The goal is to remove "client" parameter in this commit. Closes-Bug: #1657076 Change-Id: Ib19841bd66a2a7a359c51acafb64717c626c875d Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
This commit is contained in:
parent
886fa3ae00
commit
c89542ca11
@ -68,13 +68,13 @@ class InstancePropertiesTestCase(TestCase):
|
||||
@mock.patch.object(vm.PartitionInstance, 'get_partition')
|
||||
def test_partition_name(self, mock_get_part):
|
||||
inst = vm.PartitionInstance(
|
||||
self.mock_nova_inst, mock.Mock(), mock.Mock())
|
||||
self.mock_nova_inst, mock.Mock())
|
||||
self.assertEqual("OpenStack-foo-foo-id", inst.partition_name)
|
||||
|
||||
@mock.patch.object(vm.PartitionInstance, 'get_partition')
|
||||
def test_partition_description(self, mock_get_part):
|
||||
inst = vm.PartitionInstance(
|
||||
self.mock_nova_inst, mock.Mock(), mock.Mock())
|
||||
self.mock_nova_inst, mock.Mock())
|
||||
self.assertEqual("OpenStack CPCSubset=foo",
|
||||
inst.partition_description)
|
||||
|
||||
@ -85,8 +85,7 @@ class InstancePropertiesTestCase(TestCase):
|
||||
mock_flavor.memory_mb = 2000
|
||||
|
||||
inst = vm.PartitionInstance(
|
||||
self.mock_nova_inst, mock.Mock(),
|
||||
mock.Mock(), flavor=mock_flavor)
|
||||
self.mock_nova_inst, mock.Mock(), flavor=mock_flavor)
|
||||
props = inst.properties()
|
||||
self.assertEqual('OpenStack-foo-foo-id', props['name'])
|
||||
self.assertEqual('OpenStack CPCSubset=foo', props['description'])
|
||||
|
@ -220,7 +220,7 @@ class DPMDriver(driver.ComputeDriver):
|
||||
instance.instance_type_id))
|
||||
LOG.debug("Flavor = %(flavor)s" % {'flavor': flavor})
|
||||
|
||||
inst = vm.PartitionInstance(instance, self._cpc, self._client, flavor)
|
||||
inst = vm.PartitionInstance(instance, self._cpc, flavor)
|
||||
inst.create(inst.properties())
|
||||
for vif in network_info:
|
||||
inst.attach_nic(self._conf, vif)
|
||||
@ -234,19 +234,19 @@ class DPMDriver(driver.ComputeDriver):
|
||||
|
||||
def destroy(self, context, instance, network_info, block_device_info=None,
|
||||
destroy_disks=True, migrate_data=None):
|
||||
inst = vm.PartitionInstance(instance, self._cpc, self._client)
|
||||
inst = vm.PartitionInstance(instance, self._cpc)
|
||||
inst.destroy()
|
||||
|
||||
def power_off(self, instance, timeout=0, retry_interval=0):
|
||||
inst = vm.PartitionInstance(instance, self._cpc, self._client)
|
||||
inst = vm.PartitionInstance(instance, self._cpc)
|
||||
inst.power_off_vm()
|
||||
|
||||
def power_on(self, context, instance, network_info,
|
||||
block_device_info=None):
|
||||
inst = vm.PartitionInstance(instance, self._cpc, self._client)
|
||||
inst = vm.PartitionInstance(instance, self._cpc)
|
||||
inst.power_on_vm()
|
||||
|
||||
def reboot(self, context, instance, network_info, reboot_type,
|
||||
block_device_info=None, bad_volumes_callback=None):
|
||||
inst = vm.PartitionInstance(instance, self._cpc, self._client)
|
||||
inst = vm.PartitionInstance(instance, self._cpc)
|
||||
inst.reboot_vm()
|
||||
|
@ -106,11 +106,10 @@ def cpcsubset_partition_list(cpc):
|
||||
|
||||
|
||||
class PartitionInstance(object):
|
||||
def __init__(self, instance, cpc, client, flavor=None):
|
||||
def __init__(self, instance, cpc, flavor=None):
|
||||
self.instance = instance
|
||||
self.flavor = flavor
|
||||
self.cpc = cpc
|
||||
self.client = client
|
||||
self.partition = self.get_partition()
|
||||
|
||||
@property
|
||||
|
Loading…
Reference in New Issue
Block a user