Fix errors reported by shellcheck for Zuul and Nodepool

Change-Id: I2c5fbf234a1bb1c6c27a562f6b4aa6a7e2651ae2
This commit is contained in:
Sergey Kraynev 2016-08-03 12:38:06 +03:00 committed by Alexey Khivin
parent a4a52e5b54
commit 95d03fed86
3 changed files with 12 additions and 12 deletions

View File

@ -7,12 +7,12 @@ cmd="curl --user '$username:$password' http://${jenkins_host}:8080/me/configure
# Jenkins might not be ready at this point.
# Retry logic is used here.
token=$(eval $cmd)
token=$(eval "$cmd")
tries=10
while [ -z "$token" ]; do
sleep 20
token=$(eval $cmd)
token=$(eval "$cmd")
tries=$((tries-1))
@ -21,4 +21,4 @@ while [ -z "$token" ]; do
fi
done
echo $token
echo "$token"

View File

@ -9,20 +9,20 @@ server_ids=$(mysql -u nodepool --password=nodepool nodepool -e 'select external_
image_ids=$(mysql -u nodepool --password=nodepool nodepool -e 'select external_id from snapshot_image' | grep -o '[-0-9a-f]\{36\}')
# Get token and service catalog.
resp=$(curl -H "Content-Type: application/json" -X POST $OS_AUTH_URL/tokens --data '{"auth": {"tenantName": "'$OS_TENANT_NAME'", "passwordCredentials": {"username": "'$OS_USERNAME'", "password": "'$OS_PASSWORD'"}}}')
resp=$(curl -H "Content-Type: application/json" -X POST "$OS_AUTH_URL/tokens" --data '{"auth": {"tenantName": '"$OS_TENANT_NAME"', "passwordCredentials": {"username": '"$OS_USERNAME"', "password": '"$OS_PASSWORD"'}}}')
token=$(echo $resp | json_pp | grep -A15 '"token"' | sed -e '/"tenant"/,+7d' | grep '"id"' | cut -d '"' -f 4)
nova_url=$(echo $resp | json_pp | grep '8774/v2' | grep publicURL | cut -d '"' -f 4)
glance_url=$(echo $resp | json_pp | grep ':9292' | grep publicURL | cut -d '"' -f 4)
token=$(echo "$resp" | json_pp | grep -A15 '"token"' | sed -e '/"tenant"/,+7d' | grep '"id"' | cut -d '"' -f 4)
nova_url=$(echo "$resp" | json_pp | grep '8774/v2' | grep publicURL | cut -d '"' -f 4)
glance_url=$(echo "$resp" | json_pp | grep ':9292' | grep publicURL | cut -d '"' -f 4)
# Clean up servers.
for id in $server_ids
do
curl -X DELETE -H "X-Auth-Token: $token" $nova_url/servers/$id
curl -X DELETE -H "X-Auth-Token: $token" "$nova_url/servers/$id"
done
# Clean up images.
for id in $image_ids
do
curl -X DELETE -H "X-Auth-Token: $token" $glance_url/v1/images/$id
curl -X DELETE -H "X-Auth-Token: $token" "$glance_url/v1/images/$id"
done

View File

@ -4,8 +4,8 @@ datafile='/etc/puppet/hieradata/murano.yaml'
ssh-keygen -t rsa -P '' -f zuul_ssh_key -q
content=`cat zuul_ssh_key`
content=$(cat zuul_ssh_key)
puppet apply --execute "yaml_setting { 'example': target=>'$datafile', key=>'zuul_ssh_private_key_contents', value=>'$content', }"
content=`cat zuul_ssh_key.pub`
puppet apply --execute "yaml_setting { 'example': target=>'$datafile', key=>'zuul_ssh_pubkey_contents', value=>'$content', }"
content=$(cat zuul_ssh_key.pub)
puppet apply --execute "yaml_setting { 'example': target=>'$datafile', key=>'zuul_ssh_pubkey_contents', value=>'$content', }"