attach/detach_volume() take instance as a parameter

Previously the methods take instance['name'] as a parameter.
With this change, ComputeDriver can lookup informations about
the instance from hypervisor (in bare-metal driver, it is a local DB)
by any other attributes of the instance.

blueprint general-bare-metal-provisioning-framework

Change-Id: Ibd0567f34ed5053909ce1a408f9cbf87516ba597
This commit is contained in:
Arata Notsu
2012-12-20 21:29:13 +09:00
parent 7cd22aaca7
commit e6cae13dd2
13 changed files with 46 additions and 57 deletions

View File

@@ -271,7 +271,7 @@ class XenAPIVolumeTestCase(stubs.XenAPITestBase):
instance = db.instance_create(self.context, self.instance_values)
vm = xenapi_fake.create_vm(instance['name'], 'Running')
result = conn.attach_volume(self._make_connection_info(),
instance['name'], '/dev/sdc')
instance, '/dev/sdc')
# check that the VM has a VBD attached to it
# Get XenAPI record for VBD
@@ -290,7 +290,7 @@ class XenAPIVolumeTestCase(stubs.XenAPITestBase):
self.assertRaises(exception.VolumeDriverNotFound,
conn.attach_volume,
{'driver_volume_type': 'nonexist'},
instance['name'],
instance,
'/dev/sdc')