From cdf22878d8057e36f28db83c5da908035cdfb49a Mon Sep 17 00:00:00 2001 From: Yuiko Takada Date: Wed, 13 Jan 2016 15:01:54 +0900 Subject: [PATCH] Check whether agent tarball exists Currently, when execute devstack/stack.sh, agent tarball is downloaded every time even if it exists already. This patch set * checks whether kernel/ramdisk exists and if there are, doesn't down load them. * checks whether ironic agent kernel/ramdisk exists and if there are, copy them. Change-Id: Ic546ba8fc0cc14dc7cf13433e09db35a0854d115 Closes-Bug: #1533491 --- devstack/plugin.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index f4991a3d5..568aa0d65 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -116,8 +116,15 @@ function prepare_tftp { else # download the agent image tarball IRONIC_INSPECTOR_KERNEL_PATH="$IRONIC_INSPECTOR_IMAGE_PATH.kernel" - wget "$IRONIC_AGENT_KERNEL_URL" -O $IRONIC_INSPECTOR_KERNEL_PATH - wget "$IRONIC_AGENT_RAMDISK_URL" -O $IRONIC_INSPECTOR_INITRAMFS_PATH + if [ ! -e "$IRONIC_INSPECTOR_KERNEL_PATH" -o ! -e "$IRONIC_INSPECTOR_INITRAMFS_PATH" ]; then + if [ -e "$IRONIC_DEPLOY_KERNEL_PATH" -a -e "$IRONIC_DEPLOY_RAMDISK_PATH" ]; then + cp $IRONIC_DEPLOY_KERNEL_PATH $IRONIC_INSPECTOR_KERNEL_PATH + cp $IRONIC_DEPLOY_RAMDISK_PATH $IRONIC_INSPECTOR_INITRAMFS_PATH + else + wget "$IRONIC_AGENT_KERNEL_URL" -O $IRONIC_INSPECTOR_KERNEL_PATH + wget "$IRONIC_AGENT_RAMDISK_URL" -O $IRONIC_INSPECTOR_INITRAMFS_PATH + fi + fi fi else IRONIC_INSPECTOR_KERNEL_PATH="$IRONIC_INSPECTOR_IMAGE_PATH.kernel"