Packer Cleanup Script was ignoring all errors
Change-Id: I881abf36420a1976c4f3af552aeeca4a4512c555
Signed-off-by: Tim Johnson <tijohnson@linuxfoundation.org>
-#!/bin/bash
+#!/bin/bash -ue
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2017 The Linux Foundation and others.
##############################################################################
echo "---> packer-clear-credentials.sh"
-set +e # DO NOT cause build failure if any of the rm calls fail.
-rm "$CLOUDENV"
-exit 0
+# OK if $CLOUDENV does not exist or empty
+# Fails if $CLOUDENV exists and rm is unable to delete it
+rm -rf "$CLOUDENV"