hyperv: Fixes Generation 2 VMs volume boot order
The patch that introduced setting boot order to the nova Hyper-V driver [1] was using a method that no longer existed (Generation 2 VMs only). That method was renamed by the patch that refactored volumeops (to use os-brick) [2]. [1]d68c04299a
[2]758a32f7ce
Change-Id: I499f078de16b79acbf12f993e9f549c75c3fccb0 Closes-Bug: #1687570 (cherry picked from commitf842f11630
)
This commit is contained in:
parent
e4b6084148
commit
54284a4f0c
@ -407,7 +407,8 @@ class BlockDeviceManagerTestCase(test_base.HyperVBaseTestCase):
|
|||||||
res = self._bdman._get_boot_order_gen1(fake_bdi)
|
res = self._bdman._get_boot_order_gen1(fake_bdi)
|
||||||
self.assertEqual(expected, res)
|
self.assertEqual(expected, res)
|
||||||
|
|
||||||
def test_get_boot_order_gen2(self):
|
@mock.patch('nova.virt.hyperv.volumeops.VolumeOps.get_disk_resource_path')
|
||||||
|
def test_get_boot_order_gen2(self, mock_get_disk_path):
|
||||||
fake_root_disk = {'boot_index': 0,
|
fake_root_disk = {'boot_index': 0,
|
||||||
'path': mock.sentinel.FAKE_ROOT_PATH}
|
'path': mock.sentinel.FAKE_ROOT_PATH}
|
||||||
fake_eph1 = {'boot_index': 2,
|
fake_eph1 = {'boot_index': 2,
|
||||||
@ -421,8 +422,7 @@ class BlockDeviceManagerTestCase(test_base.HyperVBaseTestCase):
|
|||||||
fake_eph2],
|
fake_eph2],
|
||||||
'block_device_mapping': [fake_bdm]}
|
'block_device_mapping': [fake_bdm]}
|
||||||
|
|
||||||
self._bdman._volops.get_mounted_disk_path_from_volume = (
|
mock_get_disk_path.return_value = fake_bdm['connection_info']
|
||||||
mock.MagicMock(return_value=fake_bdm['connection_info']))
|
|
||||||
|
|
||||||
expected_res = [mock.sentinel.FAKE_ROOT_PATH,
|
expected_res = [mock.sentinel.FAKE_ROOT_PATH,
|
||||||
mock.sentinel.FAKE_CONN_INFO,
|
mock.sentinel.FAKE_CONN_INFO,
|
||||||
|
@ -259,7 +259,7 @@ class BlockDeviceInfoManager(object):
|
|||||||
boot_order = []
|
boot_order = []
|
||||||
for dev in devices:
|
for dev in devices:
|
||||||
if dev.get('connection_info'):
|
if dev.get('connection_info'):
|
||||||
dev_path = self._volops.get_mounted_disk_path_from_volume(
|
dev_path = self._volops.get_disk_resource_path(
|
||||||
dev['connection_info'])
|
dev['connection_info'])
|
||||||
boot_order.append(dev_path)
|
boot_order.append(dev_path)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user