From 2715fd0b4acf44842ceb67760bbc348093e7d70d Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Wed, 24 May 2017 11:31:56 +0300 Subject: [PATCH] Do not upload vhdx images as vhd This change ensures that when uploading vhdx images, we use the proper format. At the moment, vhdx images are uploaded as vhd, which can be troublesome: first because this is misleading, second because the actual image format may be checked, having the image rejected. Change-Id: I9578be41ea9dc252404b7553679ac527e08a0ff6 --- functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions b/functions index 52a82faf0a..689aad074e 100644 --- a/functions +++ b/functions @@ -323,7 +323,7 @@ function upload_image { *.vhd|*.vhdx|*.vhd.gz|*.vhdx.gz) local extension="${image_fname#*.}" image_name=$(basename "$image" ".$extension") - disk_format=vhd + disk_format=$(echo $image_fname | grep -oP '(?<=\.)vhdx?(?=\.|$)') container_format=bare if [ "${image_fname##*.}" == "gz" ]; then unpack=zcat