diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-03-22 19:27:36 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-03-22 19:27:36 +0000 |
commit | f59853e7993671e8150798eadf0ea14973ffe5b1 (patch) | |
tree | 79cc26a6f8c37d711d1e518f0a825047e8612107 | |
parent | 822f0dcc7c31247d4db778f088c4ca2341438512 (diff) | |
parent | 68fabab3f9e19fc8d0dd55d4f94decbff11c9cda (diff) | |
download | ironic-f59853e7993671e8150798eadf0ea14973ffe5b1.tar.gz |
Merge "Add disk_label and node_uuid for agent drivers"
-rw-r--r-- | ironic/drivers/modules/agent.py | 4 | ||||
-rw-r--r-- | ironic/tests/unit/drivers/modules/test_agent.py | 7 | ||||
-rw-r--r-- | releasenotes/notes/disk-label-fix-7580de913835ff44.yaml | 5 |
3 files changed, 14 insertions, 2 deletions
diff --git a/ironic/drivers/modules/agent.py b/ironic/drivers/modules/agent.py index 65aba00c5..0c9814bd8 100644 --- a/ironic/drivers/modules/agent.py +++ b/ironic/drivers/modules/agent.py @@ -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) diff --git a/ironic/tests/unit/drivers/modules/test_agent.py b/ironic/tests/unit/drivers/modules/test_agent.py index 147612e3e..c22a4c1e4 100644 --- a/ironic/tests/unit/drivers/modules/test_agent.py +++ b/ironic/tests/unit/drivers/modules/test_agent.py @@ -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']) diff --git a/releasenotes/notes/disk-label-fix-7580de913835ff44.yaml b/releasenotes/notes/disk-label-fix-7580de913835ff44.yaml new file mode 100644 index 000000000..b7a8d5314 --- /dev/null +++ b/releasenotes/notes/disk-label-fix-7580de913835ff44.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Fixes the bug where the user specified + disk_label is ignored for the agent + drivers for partition images. |