Fail if image delete does not succeed 09/77009/1
authorJamo Luhrsen <jluhrsen@redhat.com>
Mon, 15 Oct 2018 18:30:46 +0000 (11:30 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Mon, 15 Oct 2018 18:30:46 +0000 (11:30 -0700)
by ignoring the delte failure, we can end up
creating images with duplicate names which confuse
heat when trying to deploy stacks with images using
those names.

a delete can fail if an image is being used when
the delete is issued.

Change-Id: Iff82bd566d573cb2535236f46de9d7cb44c6aa4c
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
jjb/opendaylight-infra-apex-image-management.sh

index 9f9ac7a3c07dcd682de73d4fff6f391ce008cc16..80054fa426cab536f4ea0d51fcf1862a6d450c6f 100644 (file)
@@ -112,7 +112,7 @@ openstack image create \
 # clean out any non ".new" OPNFV - apex images. In the case of a previously failed
 # or aborted apex management job, we can end up with multiple images with the same
 # name so being thorough here.
-openstack image list | egrep 'OPNFV - apex' | egrep -v 'new' | awk '{print "openstack image delete",$2}' | sh || true
+openstack image list | egrep 'OPNFV - apex' | egrep -v 'new' | awk '{print "openstack image delete",$2}' | sh
 
 openstack image set --name "$CONTROLLER_IMAGE_NAME" "$CONTROLLER_IMAGE_NAME.new"
 openstack image set --tag "Date Uploaded: $(date)" "$CONTROLLER_IMAGE_NAME"