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
This commit is contained in:
parent
2b5b478f29
commit
f842f11630
|
@ -404,7 +404,8 @@ class BlockDeviceManagerTestCase(test_base.HyperVBaseTestCase):
|
|||
res = self._bdman._get_boot_order_gen1(fake_bdi)
|
||||
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,
|
||||
'path': mock.sentinel.FAKE_ROOT_PATH}
|
||||
fake_eph1 = {'boot_index': 2,
|
||||
|
@ -418,8 +419,7 @@ class BlockDeviceManagerTestCase(test_base.HyperVBaseTestCase):
|
|||
fake_eph2],
|
||||
'block_device_mapping': [fake_bdm]}
|
||||
|
||||
self._bdman._volops.get_mounted_disk_path_from_volume = (
|
||||
mock.MagicMock(return_value=fake_bdm['connection_info']))
|
||||
mock_get_disk_path.return_value = fake_bdm['connection_info']
|
||||
|
||||
expected_res = [mock.sentinel.FAKE_ROOT_PATH,
|
||||
mock.sentinel.FAKE_CONN_INFO,
|
||||
|
|
|
@ -258,7 +258,7 @@ class BlockDeviceInfoManager(object):
|
|||
boot_order = []
|
||||
for dev in devices:
|
||||
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'])
|
||||
boot_order.append(dev_path)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue