From 13709eaa9e5b39442cfb1392decbc083be8354fe Mon Sep 17 00:00:00 2001 From: Gary Wu Date: Thu, 15 Feb 2018 11:28:50 -0800 Subject: Explicit check for DNS zone project ID in teardown TLAB Designate configuration currently does not support project-specific DNS zones. This modifies the teardown script to avoid deleting such noauth-project DNS zones. In practice this means that no TLAB DNS zones will ever be deleted during teardown until TLAB fixes its Designate configuration. Change-Id: I43be641e4653270fd31b1a4daf9f16d4afee05ab Issue-ID: INT-414 Signed-off-by: Gary Wu --- test/ete/scripts/teardown-onap.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/ete/scripts/teardown-onap.sh b/test/ete/scripts/teardown-onap.sh index dbbee2816..3a40cfac8 100755 --- a/test/ete/scripts/teardown-onap.sh +++ b/test/ete/scripts/teardown-onap.sh @@ -11,10 +11,13 @@ source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh # $WORKSPACE/test/ete/scripts/dns-zones/delete-dns-zones.sh $OS_PROJECT_NAME # sleep 1 -# delete all Desigate DNS zones +# delete all Desigate DNS zones belonging to this project ZONES=$(openstack zone list -c "id" -f value) for ZONE in ${ZONES}; do - openstack zone delete $ZONE + ZONE_PROJECT_ID=$(openstack zone show $ZONE -f json | jq -r '.project_id') + if [ "$OS_PROJECT_ID" == "$ZONE_PROJECT_ID" ]; then + openstack zone delete $ZONE + fi done # delete all instances @@ -31,7 +34,7 @@ for ROUTER in $ROUTERS; do echo $ROUTER; PORTS=$(openstack router show $ROUTER -c "interfaces_info" -f "value" | jq -r '.[].port_id') for PORT in $PORTS; do - openstack router remove port $ROUTER $PORT + openstack router remove port $ROUTER $PORT done openstack router delete $ROUTER done -- cgit 1.2.3-korg