Merge "Fixes the agent message for uefi netboot for partition image"
This commit is contained in:
commit
32d9ff9518
@ -160,7 +160,8 @@ def _message_format(msg, image_info, device, partition_uuids):
|
||||
root_uuid = partition_uuids.get('root uuid')
|
||||
efi_system_partition_uuid = (
|
||||
partition_uuids.get('efi system partition uuid'))
|
||||
if image_info.get('deploy_boot_mode') == 'uefi':
|
||||
if (image_info.get('deploy_boot_mode') == 'uefi' and
|
||||
image_info.get('boot_option') == 'local'):
|
||||
result_msg = msg + 'root_uuid={2} efi_system_partition_uuid={3}'
|
||||
message = result_msg.format(image_info['id'], device,
|
||||
root_uuid,
|
||||
|
@ -852,9 +852,24 @@ class TestStandbyExtension(test_base.BaseTestCase):
|
||||
'/dev/fake root_uuid=root_uuid')
|
||||
self.assertEqual(expected_msg, result_msg)
|
||||
|
||||
def test__message_format_partition_uefi(self):
|
||||
def test__message_format_partition_uefi_netboot(self):
|
||||
image_info = _build_fake_partition_image_info()
|
||||
image_info['deploy_boot_mode'] = 'uefi'
|
||||
image_info['boot_option'] = 'netboot'
|
||||
msg = ('image ({0}) already present on device {1} ')
|
||||
device = '/dev/fake'
|
||||
partition_uuids = {'root uuid': 'root_uuid',
|
||||
'efi system partition uuid': None}
|
||||
result_msg = standby._message_format(msg, image_info,
|
||||
device, partition_uuids)
|
||||
expected_msg = ('image (fake_id) already present on device '
|
||||
'/dev/fake root_uuid=root_uuid')
|
||||
self.assertEqual(expected_msg, result_msg)
|
||||
|
||||
def test__message_format_partition_uefi_localboot(self):
|
||||
image_info = _build_fake_partition_image_info()
|
||||
image_info['deploy_boot_mode'] = 'uefi'
|
||||
image_info['boot_option'] = 'local'
|
||||
msg = ('image ({0}) already present on device {1} ')
|
||||
device = '/dev/fake'
|
||||
partition_uuids = {'root uuid': 'root_uuid',
|
||||
|
Loading…
Reference in New Issue
Block a user