Upload images with --file instead of stdin
This is more likely how people will actually upload their images, but it also prevents the "osc as a service" feature from working because stdin isn't proxied (of course). So just convert our uses of "image create" to use --file instead of stdin. Change-Id: I7205eb0100ba7406650ed609cf517cba2c8d30aa
This commit is contained in:
parent
aee9b0ff9e
commit
769adbd69d
@ -118,7 +118,7 @@ function _upload_image {
|
|||||||
useimport="--import"
|
useimport="--import"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name" --public --container-format "$container" --disk-format "$disk" $useimport $properties < "${image}"
|
openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name" --public --container-format "$container" --disk-format "$disk" $useimport $properties --file $(readlink -f "${image}")
|
||||||
}
|
}
|
||||||
|
|
||||||
# Retrieve an image from a URL and upload into Glance.
|
# Retrieve an image from a URL and upload into Glance.
|
||||||
@ -425,10 +425,10 @@ function upload_image {
|
|||||||
# kernel for use when uploading the root filesystem.
|
# kernel for use when uploading the root filesystem.
|
||||||
local kernel_id="" ramdisk_id="";
|
local kernel_id="" ramdisk_id="";
|
||||||
if [ -n "$kernel" ]; then
|
if [ -n "$kernel" ]; then
|
||||||
kernel_id=$(openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name-kernel" $(_image_properties_to_arg $img_property) --public --container-format aki --disk-format aki < "$kernel" -f value -c id)
|
kernel_id=$(openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name-kernel" $(_image_properties_to_arg $img_property) --public --container-format aki --disk-format aki --file $(readlink -f "$kernel") -f value -c id)
|
||||||
fi
|
fi
|
||||||
if [ -n "$ramdisk" ]; then
|
if [ -n "$ramdisk" ]; then
|
||||||
ramdisk_id=$(openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name-ramdisk" $(_image_properties_to_arg $img_property) --public --container-format ari --disk-format ari < "$ramdisk" -f value -c id)
|
ramdisk_id=$(openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name-ramdisk" $(_image_properties_to_arg $img_property) --public --container-format ari --disk-format ari --file $(readlink -f "$ramdisk") -f value -c id)
|
||||||
fi
|
fi
|
||||||
_upload_image "${image_name%.img}" ami ami "$image" ${kernel_id:+ kernel_id=$kernel_id} ${ramdisk_id:+ ramdisk_id=$ramdisk_id} $img_property
|
_upload_image "${image_name%.img}" ami ami "$image" ${kernel_id:+ kernel_id=$kernel_id} ${ramdisk_id:+ ramdisk_id=$ramdisk_id} $img_property
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user