summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rwxr-xr-xutils/gpg_import_key.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/utils/gpg_import_key.sh b/utils/gpg_import_key.sh
index f45e40919..94ffbaab5 100755
--- a/utils/gpg_import_key.sh
+++ b/utils/gpg_import_key.sh
@@ -51,10 +51,14 @@ else
if [ -z "$NODE_NAME" ];
then echo "Cannot find node name"
exit 0
- else echo "Importing key for '$NODE_NAME'";
- gsutil cp gs://opnfv-signing-keys/"$NODE_NAME"-subkey .
- gpg2 --import "$NODE_NAME"-subkey
- rm -f "$NODE_NAME"-subkey
- fi
+ elif gsutil ls gs://opnfv-signing-keys | grep $NODE_NAME; then
+ echo "Importing key for '$NODE_NAME'"
+ gsutil cp gs://opnfv-signing-keys/"$NODE_NAME"-subkey .
+ gpg2 --import "$NODE_NAME"-subkey
+ rm -f "$NODE_NAME"-subkey
+ else
+ echo "No keys found locally or remotely for host, skipping import"
+ exit 0
+ fi
fi