Merge pull request #116 from divius/master

Stop hardcoding Ironic URL
This commit is contained in:
James Slagle 2015-02-04 07:59:20 -05:00
commit f562625a70
1 changed files with 5 additions and 3 deletions

View File

@ -59,6 +59,8 @@ CONFIG_TOOLS_PROVISION=
STDERR=/dev/null
DEPLOY_NAME=${DEPLOY_NAME:-"ironic-discover"}
IRONIC=$(keystone endpoint-get --service baremetal | grep publicURL | awk '{ print $4; }')
IRONIC=${IRONIC%/}
while true ; do
case "$1" in
@ -229,7 +231,7 @@ function show_profile {
for node_id in $node_ids; do
echo " $node_id"
echo -n " "
curl -s -H "x-auth-token: $token" http://192.0.2.1:6385/v1/nodes/$node_id | jq '.properties.capabilities'
curl -s -H "x-auth-token: $token" $IRONIC/v1/nodes/$node_id | jq '.properties.capabilities'
echo
done
echo
@ -246,8 +248,8 @@ function wait_for_hypervisor_stats {
token=$(keystone token-get | grep ' id ' | awk '{print $4}')
echo -n " Wating for nova hypervisor stats ... "
for node_id in $node_ids; do
mem=$(curl -s -H "x-auth-token: $token" http://192.0.2.1:6385/v1/nodes/$node_id | jq '.properties.memory_mb | tonumber')
vcpu=$(curl -s -H "x-auth-token: $token" http://192.0.2.1:6385/v1/nodes/$node_id | jq '.properties.cpus | tonumber')
mem=$(curl -s -H "x-auth-token: $token" $IRONIC/v1/nodes/$node_id | jq '.properties.memory_mb | tonumber')
vcpu=$(curl -s -H "x-auth-token: $token" $IRONIC/v1/nodes/$node_id | jq '.properties.cpus | tonumber')
expected_memory=$(($expected_memory + $mem))
expected_vcpus=$(($expected_vcpus + $vcpu))
done