From 3b01c25368e43aac8fd424585a51ffd65d539812 Mon Sep 17 00:00:00 2001 From: Blaisonneau David Date: Wed, 26 Apr 2017 17:46:28 +0200 Subject: [PATCH] add function to delete existing netw Change-Id: Ib2b61aa1c61557beb6b879cc879e57235aced866 Signed-off-by: Blaisonneau David --- ci/03-maasdeploy.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ci/03-maasdeploy.sh b/ci/03-maasdeploy.sh index fdde0108..505e167f 100755 --- a/ci/03-maasdeploy.sh +++ b/ci/03-maasdeploy.sh @@ -231,14 +231,20 @@ configuremaas(){ done } +deleteexistingnetw(){ + NETID_LIST=$(maas $PROFILE subnets read | jq ".[].id") + for NETID in $NETW; do + maas $PROFILE subnet delete $NETID_LIST + done +} + setopnfvfabrics(){ # Based on first node we get the fabric mapping NODE_0_MAC_LIST=$(cat labconfig.json | jq --raw-output ".lab.racks[0].nodes[0].nics[] ".mac[] | sort -u) FAB_ID=1 for MAC in $NODE_0_MAC_LIST; do # Create a new fabric - # SPACE_ID=$(maas $PROFILE fabrics create name=opnfv$FAB_ID| jq --raw-output ".id") - FABRIC_ID=$(maas $PROFILE fabric read opnfv$FAB_ID| jq --raw-output ".id") + FABRIC_ID=$(maas $PROFILE fabrics create name=opnfv$FAB_ID| jq --raw-output ".id") # Get the spaces attached to a mac IF_SPACES=$(cat labconfig.json | jq --raw-output ".lab.racks[0].nodes[$NODE_ID].nics[] | select(.mac[] | contains(\"$MAC\")) ".spaces[]) # Create the network attached to a space -- 2.16.6