From b2494dd531cd0b5692301c5b6f5186f0df76d402 Mon Sep 17 00:00:00 2001 From: Nir Magnezi Date: Thu, 9 Feb 2017 16:39:43 +0200 Subject: [PATCH] Adds devstack plugin support for all amp base OS Set OCTAVIA_AMP_BASE_OS to pass any option accepted by the diskimage-create.sh script: ubuntu | fedora | centos | rhel Set OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID to pass release name for the selected (either by OCTAVIA_AMP_BASE_OS or by default) operating system. Set OCTAVIA_AMP_IMAGE_SIZE to pass the image size (by GB). If unset, the above mentioned options are not used in the script call and thus, the script will use its default values. Related-Bug #1548070 Change-Id: If1139594cf23d9de413ce2603aaa5c1e012c7790 --- devstack/plugin.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 989523eb92..7f6ab130ea 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -39,8 +39,17 @@ function build_octavia_worker_image { if [ "$OCTAVIA_DIB_TRACING" != "0" ]; then octavia_dib_tracing_arg="-x" fi + if [[ ${OCTAVIA_AMP_BASE_OS:+1} ]] ; then + export PARAM_OCTAVIA_AMP_BASE_OS='-i '$OCTAVIA_AMP_BASE_OS + fi + if [[ ${OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID:+1} ]] ; then + export PARAM_OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID='-d '$OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID + fi + if [[ ${OCTAVIA_AMP_IMAGE_SIZE:+1} ]] ; then + export PARAM_OCTAVIA_AMP_IMAGE_SIZE='-s '$OCTAVIA_AMP_IMAGE_SIZE + fi if ! [ -f $OCTAVIA_AMP_IMAGE_FILE ]; then - $OCTAVIA_DIR/diskimage-create/diskimage-create.sh $octavia_dib_tracing_arg -s 2 -o $OCTAVIA_AMP_IMAGE_FILE + $OCTAVIA_DIR/diskimage-create/diskimage-create.sh $octavia_dib_tracing_arg -o $OCTAVIA_AMP_IMAGE_FILE ${PARAM_OCTAVIA_AMP_BASE_OS:-''} ${PARAM_OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID:-''} ${PARAM_OCTAVIA_AMP_IMAGE_SIZE:-''} fi upload_image file://${OCTAVIA_AMP_IMAGE_FILE} $TOKEN