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 commit f842f11630)
This commit is contained in:
Claudiu Belu 2017-05-02 12:08:34 +03:00 committed by Matt Riedemann
parent e4b6084148
commit 54284a4f0c
2 changed files with 4 additions and 4 deletions

View File

@ -407,7 +407,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,
@ -421,8 +422,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,

View File

@ -259,7 +259,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: