Fix script when CLEAN_DIB_IMAGES var is not set 65/20665/1
authorYolanda Robla Mota <yroblamo@redhat.com>
Thu, 8 Sep 2016 09:48:41 +0000 (11:48 +0200)
committerYolanda Robla Mota <yroblamo@redhat.com>
Thu, 8 Sep 2016 09:59:07 +0000 (11:59 +0200)
It relies on this var being exported, and if the script
is ran manually and this var is not set, it crashes. Adding
a default to this var to avoid this failure.

Change-Id: I5c61a1d9f1aafe2d6c64af70d3237b6c5b0d1e1d
Signed-Off-By: Yolanda Robla <yroblamo@redhat.com>
prototypes/bifrost/scripts/destroy-env.sh

index 4dffee6..f092a65 100755 (executable)
@@ -27,6 +27,8 @@ echo "removing logs"
 rm -rf /var/log/libvirt/baremetal_logs/*.log
 
 # clean up dib images only if requested explicitly
+CLEAN_DIB_IMAGES=${CLEAN_DIB_IMAGES:-false}
+
 if [ $CLEAN_DIB_IMAGES = "true" ]; then
     rm -rf /httpboot/*
     rm -rf /tftpboot/*