From: Tim Johnson Date: Fri, 15 Feb 2019 18:21:52 +0000 (-0800) Subject: Add Error Handling X-Git-Tag: v0.31.0^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F14602%2F1;p=releng%2Fglobal-jjb.git Add Error Handling Packer Cleanup Script was ignoring all errors Change-Id: I881abf36420a1976c4f3af552aeeca4a4512c555 Signed-off-by: Tim Johnson --- 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"