-#!/bin/bash
+#!/bin/bash -ue
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2017 The Linux Foundation and others.
##############################################################################
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"