From 818e2063e9fe7d580eb38ee13f8d470336d88805 Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Jan 29 2018 13:46:48 +0000 Subject: bin/prepare_test_highstate_env.sh: improve the condition of sedding secrets this covers the case where there are no secrets pillars yet --- diff --git a/bin/prepare_test_highstate_env.sh b/bin/prepare_test_highstate_env.sh index 022ca5b..efeddb1 100755 --- a/bin/prepare_test_highstate_env.sh +++ b/bin/prepare_test_highstate_env.sh @@ -42,4 +42,7 @@ ID=$(hostname -f) ROLES=$(bin/get_roles.py -o yaml) printf "city:\ncountry:\ndomain: infra.opensuse.org\nosfullname:\nosmajorrelease:\nosrelease_info:\n$ROLES\nsalt_cluster: opensuse\nvirt_cluster:\n" > /etc/salt/grains printf "grains:\n city: nuremberg\n country: de\n hostusage: test\n salt_cluster: opensuse\n virt_cluster: atreju\n" > pillar/id/${ID//./_}.sls -[[ -n $STRIP_SECRETS ]] && sed -i -e "s#\- secrets\..*#- id.${ID//./_}#g" $(grep -lr "\- secrets\." pillar) +SECRETS=$(grep -lr "\- secrets\." pillar) +if [[ -n $STRIP_SECRETS ]] && [[ -n $SECRETS ]]; then + sed -i -e "s#\- secrets\..*#- id.${ID//./_}#g" $SECRETS +fi