summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-11-01 10:17:12 +0000
committerGerrit Code Review <review@openstack.org>2012-11-01 10:17:12 +0000
commit3b2e0c6009e60d2a77844dcbce3f9be53e931fbb (patch)
tree513d1bafce83cff6b184db77696c67f6ed748146
parent7db75002668dfc9d91914feaea67f49f947099b9 (diff)
parentef0726425c52784ade6aa26a8cd3f01729dc59c5 (diff)
downloadnova-3b2e0c6009e60d2a77844dcbce3f9be53e931fbb.tar.gz
nova-3b2e0c6009e60d2a77844dcbce3f9be53e931fbb.tar.xz
nova-3b2e0c6009e60d2a77844dcbce3f9be53e931fbb.zip
Merge "Fix copy-paste bug in block_device_info_generation"
-rw-r--r--nova/compute/api.py2
-rw-r--r--nova/tests/compute/test_compute.py14
2 files changed, 9 insertions, 7 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 601b75e86..9e5971862 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -1419,7 +1419,7 @@ class API(base.Base):
if cinfo and 'serial' not in cinfo:
cinfo['serial'] = bdm['volume_id']
bdmap = {'connection_info': cinfo,
- 'mount_device': bdm['volume_id'],
+ 'mount_device': bdm['device_name'],
'delete_on_termination': bdm['delete_on_termination']}
block_device_mapping.append(bdmap)
except TypeError:
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 9abca178f..8a5ced502 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -3441,14 +3441,14 @@ class ComputeAPITestCase(BaseTestCase):
'preserved': 'preserve this!'})
db.instance_destroy(self.context, instance['uuid'])
- def _stub_out_reboot(self, volume_id):
+ def _stub_out_reboot(self, device_name):
def fake_reboot_instance(rpcapi, context, instance,
block_device_info,
network_info,
reboot_type):
self.assertEqual(
block_device_info['block_device_mapping'][0]['mount_device'],
- volume_id)
+ device_name)
self.assertEqual(network_info[0]['network']['bridge'], 'fake_br1')
self.stubs.Set(nova.compute.rpcapi.ComputeAPI, 'reboot_instance',
fake_reboot_instance)
@@ -3462,8 +3462,9 @@ class ComputeAPITestCase(BaseTestCase):
self.compute.run_instance(self.context, instance=instance)
volume_id = 'fake'
+ device_name = '/dev/vdc'
volume = {'instance_uuid': instance['uuid'],
- 'device_name': '/dev/vdc',
+ 'device_name': device_name,
'delete_on_termination': False,
'connection_info': '{"foo": "bar"}',
'volume_id': volume_id}
@@ -3473,7 +3474,7 @@ class ComputeAPITestCase(BaseTestCase):
self.assertEqual(inst_ref['task_state'], None)
reboot_type = "SOFT"
- self._stub_out_reboot(volume_id)
+ self._stub_out_reboot(device_name)
self.compute_api.reboot(self.context, inst_ref, reboot_type)
inst_ref = db.instance_get_by_uuid(self.context, inst_ref['uuid'])
@@ -3487,8 +3488,9 @@ class ComputeAPITestCase(BaseTestCase):
self.compute.run_instance(self.context, instance=instance)
volume_id = 'fake'
+ device_name = '/dev/vdc'
volume = {'instance_uuid': instance['uuid'],
- 'device_name': '/dev/vdc',
+ 'device_name': device_name,
'delete_on_termination': False,
'connection_info': '{"foo": "bar"}',
'volume_id': volume_id}
@@ -3498,7 +3500,7 @@ class ComputeAPITestCase(BaseTestCase):
self.assertEqual(inst_ref['task_state'], None)
reboot_type = "HARD"
- self._stub_out_reboot(volume_id)
+ self._stub_out_reboot(device_name)
self.compute_api.reboot(self.context, inst_ref, reboot_type)
inst_ref = db.instance_get_by_uuid(self.context, inst_ref['uuid'])