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
This commit is contained in:
Michael Davies 2019-08-27 15:31:25 +09:30
parent 98c54cd564
commit b560bade60
1 changed files with 11 additions and 3 deletions

View File

@ -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