From: Blaisonneau David Date: Wed, 26 Apr 2017 15:46:28 +0000 (+0200) Subject: add function to delete existing netw X-Git-Tag: opnfv-5.0.RC1~134 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=3b01c25368e43aac8fd424585a51ffd65d539812;p=joid.git add function to delete existing netw Change-Id: Ib2b61aa1c61557beb6b879cc879e57235aced866 Signed-off-by: Blaisonneau David --- 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