From 4ada8fbad994cdcb78c547742f4fe97456949193 Mon Sep 17 00:00:00 2001 From: Tim Johnson Date: Fri, 15 Feb 2019 10:21:52 -0800 Subject: [PATCH] Add Error Handling Packer Cleanup Script was ignoring all errors Change-Id: I881abf36420a1976c4f3af552aeeca4a4512c555 Signed-off-by: Tim Johnson --- shell/packer-clear-credentials.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/packer-clear-credentials.sh b/shell/packer-clear-credentials.sh index 093b16b4..866edcf5 100644 --- a/shell/packer-clear-credentials.sh +++ b/shell/packer-clear-credentials.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -ue # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -10,6 +10,6 @@ ############################################################################## 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" -- 2.16.6