From 09b1fc673ac8ef5fea5b2667898d983ca5baec9e Mon Sep 17 00:00:00 2001 From: kesper Date: Thu, 6 Apr 2017 07:16:46 +0000 Subject: [PATCH] Bypassing upload deploy ramdisk/kernel to glance when deploy iso is given Deploy kernel and ramdisk are not required for deployment when deploy iso is intended to be used for provisioning. This fix bypass uploading of deploy ramdisk/kernel to glance when deploy iso is given. Change-Id: I201b899abb1beb18454b6e2ac563c652201867a1 --- devstack/lib/ironic | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 6c5a89799c..7dd509d631 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -1897,23 +1897,24 @@ function upload_baremetal_ironic_deploy { fi # load them into glance - IRONIC_DEPLOY_KERNEL_ID=$(openstack \ - image create \ - $ironic_deploy_kernel_name \ - --public --disk-format=aki \ - --container-format=aki \ - < $IRONIC_DEPLOY_KERNEL | grep ' id ' | get_field 2) - die_if_not_set $LINENO IRONIC_DEPLOY_KERNEL_ID "Failed to load kernel image into glance" + if ! is_deploy_iso_required; then + IRONIC_DEPLOY_KERNEL_ID=$(openstack \ + image create \ + $ironic_deploy_kernel_name \ + --public --disk-format=aki \ + --container-format=aki \ + < $IRONIC_DEPLOY_KERNEL | grep ' id ' | get_field 2) + die_if_not_set $LINENO IRONIC_DEPLOY_KERNEL_ID "Failed to load kernel image into glance" - IRONIC_DEPLOY_RAMDISK_ID=$(openstack \ - image create \ - $ironic_deploy_ramdisk_name \ - --public --disk-format=ari \ - --container-format=ari \ - < $IRONIC_DEPLOY_RAMDISK | grep ' id ' | get_field 2) - die_if_not_set $LINENO IRONIC_DEPLOY_RAMDISK_ID "Failed to load ramdisk image into glance" + IRONIC_DEPLOY_RAMDISK_ID=$(openstack \ + image create \ + $ironic_deploy_ramdisk_name \ + --public --disk-format=ari \ + --container-format=ari \ + < $IRONIC_DEPLOY_RAMDISK | grep ' id ' | get_field 2) + die_if_not_set $LINENO IRONIC_DEPLOY_RAMDISK_ID "Failed to load ramdisk image into glance" - if is_deploy_iso_required; then + else IRONIC_DEPLOY_ISO_ID=$(openstack \ image create \ $(basename $IRONIC_DEPLOY_ISO) \