From af8eeebeb8155252b7f82d070d24080f391685ba Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Tue, 14 Jan 2014 19:45:10 +0000 Subject: [PATCH] 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 --- elements/deploy-ironic/init.d/80-deploy-ironic | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/elements/deploy-ironic/init.d/80-deploy-ironic b/elements/deploy-ironic/init.d/80-deploy-ironic index 5402e86d..9dc05853 100644 --- a/elements/deploy-ironic/init.d/80-deploy-ironic +++ b/elements/deploy-ironic/init.d/80-deploy-ironic @@ -36,12 +36,12 @@ fi DATA="'{\"address\":\"$BOOT_IP_ADDRESS\",\"key\":\"$DEPLOYMENT_KEY\",\"iqn\":\"$ISCSI_TARGET_IQN\",\"error\":\"$FIRST_ERR_MSG\"}'" echo "request Ironic API to deploy image" -curl \ - -X POST \ - -H 'Content-Type: application/json' \ - $TOKEN_HEADER \ - -d $DATA \ - $IRONIC_API_URL/nodes/$DEPLOYMENT_ID/vendor_passthru/pass_deploy_info +eval curl -i -X POST \ + "$TOKEN_HEADER" \ + "-H 'Accept: application/json'" \ + "-H 'Content-Type: application/json'" \ + -d "$DATA" \ + $IRONIC_API_URL/nodes/$DEPLOYMENT_ID/vendor_passthru/pass_deploy_info echo "waiting for notice of complete" nc -l -p 10000