Browse code

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

Lucian Petrut authored on 2017/05/24 17:31:56
Showing 1 changed files
... ...
@@ -323,7 +323,7 @@ function upload_image {
323 323
         *.vhd|*.vhdx|*.vhd.gz|*.vhdx.gz)
324 324
             local extension="${image_fname#*.}"
325 325
             image_name=$(basename "$image" ".$extension")
326
-            disk_format=vhd
326
+            disk_format=$(echo $image_fname | grep -oP '(?<=\.)vhdx?(?=\.|$)')
327 327
             container_format=bare
328 328
             if [ "${image_fname##*.}" == "gz" ]; then
329 329
                 unpack=zcat