Chore: Upgrade Jenkins-job-builder to 6.3.0
[releng/global-jjb.git] / shell / packer-clear-credentials.sh
index 099f559..866edcf 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -ue
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
@@ -10,8 +10,6 @@
 ##############################################################################
 echo "---> packer-clear-credentials.sh"
 
-#!/bin/bash
-set +e  # DO NOT cause build failure if any of the rm calls fail.
-rm "$CLOUDENV"
-rm "$HOME/.config/openstack/clouds.yaml"
-exit 0
+# OK if $CLOUDENV does not exist or empty
+# Fails if $CLOUDENV exists and rm is unable to delete it
+rm -rf "$CLOUDENV"