From 1c5f9aea33ca04106e56c6997785e4ddb551f0c7 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Fri, 12 Oct 2018 13:50:59 +0200 Subject: [PATCH] Allow streaming raw partition images This change removes the safeguard that prevented the partition images from being converted to the raw format when HTTP is used as a source. Story: #2003809 Task: #26567 Change-Id: If43ca82a830e416596dc751256d0a3bcce4a5630 Depends-On: https://review.openstack.org/#/c/605707/ --- ironic/drivers/modules/deploy_utils.py | 3 +-- ironic/tests/unit/drivers/modules/test_deploy_utils.py | 2 +- .../notes/streaming-partition-images-d58fe619658b066e.yaml | 6 ++++++ 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/streaming-partition-images-d58fe619658b066e.yaml diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py index 3443e9daf8..033447a722 100644 --- a/ironic/drivers/modules/deploy_utils.py +++ b/ironic/drivers/modules/deploy_utils.py @@ -1098,8 +1098,7 @@ def direct_deploy_should_convert_raw_image(node): :returns: Boolean, whether the direct deploy interface should convert image to raw. """ - iwdi = node.driver_internal_info.get('is_whole_disk_image') - return CONF.force_raw_images and CONF.agent.stream_raw_images and iwdi + return CONF.force_raw_images and CONF.agent.stream_raw_images @image_cache.cleanup(priority=50) diff --git a/ironic/tests/unit/drivers/modules/test_deploy_utils.py b/ironic/tests/unit/drivers/modules/test_deploy_utils.py index fa345cf03b..1964c3213b 100644 --- a/ironic/tests/unit/drivers/modules/test_deploy_utils.py +++ b/ironic/tests/unit/drivers/modules/test_deploy_utils.py @@ -1753,7 +1753,7 @@ class AgentMethodsTestCase(db_base.DbTestCase): internal_info = self.node.driver_internal_info internal_info['is_whole_disk_image'] = False self.node.driver_internal_info = internal_info - self.assertFalse( + self.assertTrue( utils.direct_deploy_should_convert_raw_image(self.node)) diff --git a/releasenotes/notes/streaming-partition-images-d58fe619658b066e.yaml b/releasenotes/notes/streaming-partition-images-d58fe619658b066e.yaml new file mode 100644 index 0000000000..d0994bdd66 --- /dev/null +++ b/releasenotes/notes/streaming-partition-images-d58fe619658b066e.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Allows streaming raw partition images to the ramdisk when using the + ``direct`` deploy interface. Requires **ironic-python-agent** from + the Stein release series.