summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLusheng Ji <lji@research.att.com>2017-11-01 19:43:07 -0400
committerLusheng Ji <lji@research.att.com>2017-11-01 19:43:14 -0400
commita126e03d8ea3bf506c5f78c7d70753980f042521 (patch)
treef54b25d15d467035fb91d71804023569bd7d1503
parent9bfcf1713e3340dff868fd50d130403ab990bbfb (diff)
Fix register DNS zone
Issue-Id: DCAEGEN2-187 Change-Id: I77a5b4d005d9e4b19fe46940e5b121666f682f23 Signed-off-by: Lusheng Ji <lji@research.att.com>
-rwxr-xr-x[-rw-r--r--]boot/dcae2_vm_init.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/boot/dcae2_vm_init.sh b/boot/dcae2_vm_init.sh
index fb37b717..0d9bebce 100644..100755
--- a/boot/dcae2_vm_init.sh
+++ b/boot/dcae2_vm_init.sh
@@ -397,7 +397,7 @@ register_dns_zone()
fi
local PROJECTID
- PROJECTID=$(curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones?name=${ZONENAME}" |sed 's/^.*"project_id":"\([a-zA-Z0-9-]*\)",.*$/\1/')
+ PROJECTID=$(curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones?name=${ZONENAME}" |grep 'project_id' |sed 's/^.*"project_id":"\([a-zA-Z0-9-]*\)",.*$/\1/')
if [ ! -z "$PROJECTID" ]; then
### query the zone with zone id
echo "!!!!!!> zone $ZONENAME already registered by project $PROJECTID"
@@ -416,8 +416,8 @@ register_dns_zone()
#curl -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones?name=${ZONENAME}"
### export ZONE id
- #local ZONEID
- #ZONEID=$(curl -v -s -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones?name=${ZONENAME}" |sed 's/^.*"id":"\([a-zA-Z0-9-]*\)",.*$/\1/')
+ local ZONEID
+ ZONEID=$(curl -v -sb -H "Content-Type: application/json" -H "X-Auth-Token: $TOKEN" -X GET "${MULTICLOUD_PLUGIN_ENDPOINT}/dns-delegate/v2/zones?name=${ZONENAME}" |grep 'id' |sed 's/^.*"id":"\([a-zA-Z0-9-]*\)",.*$/\1/')
echo "=====> After creation, zone $ZONENAME ID is $ZONEID"
### query the zone with zone id