Fix the curl command in the ironic-deploy element

We need to use the eval command together with curl so that the
$TOKEN_HEADER variable is seems by curl as two arguments: "-H" and
"'X-Auth-Token: ...". Without the eval bash would interpret the variable
as only one argument "-H 'X-Auth-Token: ...'" making the curl command
to not understand that parameter and fail to pass the auth_token to the
Ironic API.

Change-Id: I4dcfc323d6ab9b7fa207328386ef65a146a93617
This commit is contained in:
Lucas Alvares Gomes 2014-01-14 19:45:10 +00:00
parent 016fc76d84
commit af8eeebeb8

View File

@ -36,12 +36,12 @@ fi
DATA="'{\"address\":\"$BOOT_IP_ADDRESS\",\"key\":\"$DEPLOYMENT_KEY\",\"iqn\":\"$ISCSI_TARGET_IQN\",\"error\":\"$FIRST_ERR_MSG\"}'" DATA="'{\"address\":\"$BOOT_IP_ADDRESS\",\"key\":\"$DEPLOYMENT_KEY\",\"iqn\":\"$ISCSI_TARGET_IQN\",\"error\":\"$FIRST_ERR_MSG\"}'"
echo "request Ironic API to deploy image" echo "request Ironic API to deploy image"
curl \ eval curl -i -X POST \
-X POST \ "$TOKEN_HEADER" \
-H 'Content-Type: application/json' \ "-H 'Accept: application/json'" \
$TOKEN_HEADER \ "-H 'Content-Type: application/json'" \
-d $DATA \ -d "$DATA" \
$IRONIC_API_URL/nodes/$DEPLOYMENT_ID/vendor_passthru/pass_deploy_info $IRONIC_API_URL/nodes/$DEPLOYMENT_ID/vendor_passthru/pass_deploy_info
echo "waiting for notice of complete" echo "waiting for notice of complete"
nc -l -p 10000 nc -l -p 10000