Skip to content
Snippets Groups Projects
Commit 8474b40c authored by František Dvořák's avatar František Dvořák
Browse files

Hadoop: more robust delete of the release candidate images

* handle duplicities - use id
* handle usage - deactivate first
parent 2308c13c
No related branches found
No related tags found
No related merge requests found
Pipeline #539 passed
...@@ -6,6 +6,10 @@ fi ...@@ -6,6 +6,10 @@ fi
IMAGE="${2:-debian-9-x86_64_hadoop}" IMAGE="${2:-debian-9-x86_64_hadoop}"
export OS_CLOUD="${OS_CLOUD:-openstack}" export OS_CLOUD="${OS_CLOUD:-openstack}"
openstack image delete "$IMAGE" >/dev/null 2>&1 || : for id in `openstack image list --name "$IMAGE" --column ID -f value`; do
oldname="$IMAGE".`date --date=$created '+%Y-%m-%d'`
openstack image set --name $oldname --deactivate "$id" || :
openstack image delete "$id" || :
done
openstack image create --file "$1" --property default_user=debian --property hw_scsi_model=virtio-scsi --property hw_disk_bus=scsi --property hw_rng_model=virtio --property hw_qemu_guest_agent=yes --property os_require_quiesce=yes --property os_type=linux --property os_distro=debian "$IMAGE" openstack image create --file "$1" --property default_user=debian --property hw_scsi_model=virtio-scsi --property hw_disk_bus=scsi --property hw_rng_model=virtio --property hw_qemu_guest_agent=yes --property os_require_quiesce=yes --property os_type=linux --property os_distro=debian "$IMAGE"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment