summaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorBlaisonneau David <david.blaisonneau@orange.com>2017-04-26 17:46:28 +0200
committerBlaisonneau David <david.blaisonneau@orange.com>2017-04-26 17:46:28 +0200
commit3b01c25368e43aac8fd424585a51ffd65d539812 (patch)
treef84d1430d1e9ecb21f0a63321503077b31a948de /ci
parent044696b8a5e4384f347bbef1d93e0547b4f1d4bc (diff)
add function to delete existing netw
Change-Id: Ib2b61aa1c61557beb6b879cc879e57235aced866 Signed-off-by: Blaisonneau David <david.blaisonneau@orange.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/03-maasdeploy.sh10
1 files 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