From c29afa82c554baddd3a3360404c97bb6fbe5e035 Mon Sep 17 00:00:00 2001 From: Eric Wiseblatt Date: Fri, 25 Mar 2016 19:26:14 +0000 Subject: [PATCH] Ignore empty metadata values --- install/first_google_boot.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install/first_google_boot.sh b/install/first_google_boot.sh index d21e49b..dd2f6da 100755 --- a/install/first_google_boot.sh +++ b/install/first_google_boot.sh @@ -81,7 +81,7 @@ function clear_metadata_to_file() { local path="$2" local value=$(get_instance_metadata_attribute "$key") - if [[ "$value" != "" ]]; then + if [[ $value = *[![:space:]]* ]]; then echo "$value" > $path chown spinnaker:spinnaker $path clear_instance_metadata "$key" @@ -89,6 +89,9 @@ function clear_metadata_to_file() { die "Could not clear metadata from $key" fi return 0 + elif [[ $value != "" ]]; then + # Clear key anyway, but act as if it werent there. + clear_instance_metadata "$key" fi return 1