Add disk_label and node_uuid for agent drivers
This fix adds the 'disk_label' and 'node_uuid' options in image_info for partition images for agent drivers. Closes-Bug: 1560560 Change-Id: Ife9897f293a0ddff8e01d1c57a2f0bc4ad2e9016
This commit is contained in:
parent
0ad5b13b5a
commit
68fabab3f9
@ -486,6 +486,10 @@ class AgentVendorInterface(agent_base_vendor.BaseAgentVendor):
|
||||
else:
|
||||
image_info['deploy_boot_mode'] = 'bios'
|
||||
image_info['boot_option'] = boot_option
|
||||
disk_label = deploy_utils.get_disk_label(node)
|
||||
if disk_label is not None:
|
||||
image_info['disk_label'] = disk_label
|
||||
image_info['node_uuid'] = node.uuid
|
||||
|
||||
# Tell the client to download and write the image with the given args
|
||||
self._client.prepare_image(node, image_info)
|
||||
|
@ -690,7 +690,8 @@ class TestAgentVendor(db_base.DbTestCase):
|
||||
i_info['image_type'] = 'partition'
|
||||
i_info['root_mb'] = 10240
|
||||
i_info['deploy_boot_mode'] = 'bios'
|
||||
i_info['capabilities'] = '{"boot_option": "local"}'
|
||||
i_info['capabilities'] = {"boot_option": "local",
|
||||
"disk_label": "msdos"}
|
||||
self.node.instance_info = i_info
|
||||
driver_internal_info = self.node.driver_internal_info
|
||||
driver_internal_info['is_whole_disk_image'] = False
|
||||
@ -700,6 +701,7 @@ class TestAgentVendor(db_base.DbTestCase):
|
||||
expected_image_info = {
|
||||
'urls': [test_temp_url],
|
||||
'id': 'fake-image',
|
||||
'node_uuid': self.node.uuid,
|
||||
'checksum': 'checksum',
|
||||
'disk_format': 'qcow2',
|
||||
'container_format': 'bare',
|
||||
@ -715,7 +717,8 @@ class TestAgentVendor(db_base.DbTestCase):
|
||||
'image_type': 'partition',
|
||||
'root_mb': 10240,
|
||||
'boot_option': 'local',
|
||||
'deploy_boot_mode': 'bios'
|
||||
'deploy_boot_mode': 'bios',
|
||||
'disk_label': 'msdos'
|
||||
}
|
||||
|
||||
client_mock = mock.MagicMock(spec_set=['prepare_image'])
|
||||
|
5
releasenotes/notes/disk-label-fix-7580de913835ff44.yaml
Normal file
5
releasenotes/notes/disk-label-fix-7580de913835ff44.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- Fixes the bug where the user specified
|
||||
disk_label is ignored for the agent
|
||||
drivers for partition images.
|
Loading…
Reference in New Issue
Block a user