From b560bade60dcc238285028858633d729443c6046 Mon Sep 17 00:00:00 2001 From: Michael Davies Date: Tue, 27 Aug 2019 15:31:25 +0930 Subject: [PATCH] Adding file uri support for ipa image location Allow ipa kernel/disk images to be specified via file:// designator so they can be locally hosted in addition to being available over http. Change-Id: If3e32f30a7df27113721e15bff9ecaae16bfe8d4 --- devstack/lib/ironic | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 165b218e6c..d527ad8ccd 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -2619,9 +2619,17 @@ function upload_baremetal_ironic_deploy { die $LINENO "Deploy kernel+ramdisk or iso files don't exist and cannot be built in OFFLINE mode" fi else - # download the agent image tarball - wget "$IRONIC_AGENT_KERNEL_URL" -O $IRONIC_DEPLOY_KERNEL - wget "$IRONIC_AGENT_RAMDISK_URL" -O $IRONIC_DEPLOY_RAMDISK + # Grab the agent image tarball, either from a local file or remote URL + if [[ "$IRONIC_AGENT_KERNEL_URL" =~ "file://" ]]; then + cp ${IRONIC_AGENT_KERNEL_URL:7} $IRONIC_DEPLOY_KERNEL + else + wget "$IRONIC_AGENT_KERNEL_URL" -O $IRONIC_DEPLOY_KERNEL + fi + if [[ "$IRONIC_AGENT_RAMDISK_URL" =~ "file://" ]]; then + cp ${IRONIC_AGENT_RAMDISK_URL:7} $IRONIC_DEPLOY_RAMDISK + else + wget "$IRONIC_AGENT_RAMDISK_URL" -O $IRONIC_DEPLOY_RAMDISK + fi if is_ansible_with_tinyipa; then # NOTE(pas-ha) if using ansible-deploy and tinyipa, # this will rebuild ramdisk and override $IRONIC_DEPLOY_RAMDISK