blob: 993643cfd15fdd2509d3d9554c6b0fa3420a4606 [file] [log] [blame]
Scott Bakerf93a06c2016-07-11 17:04:49 -07001FN=$SETUPDIR/virtualbng.json
2
3rm -f $FN
4
5cat >> $FN <<EOF
6{
7 "localPublicIpPrefixes" : [
8 "10.254.0.128/25"
9 ],
10 "nextHopIpAddress" : "10.254.0.1",
11 "publicFacingMac" : "00:00:00:00:00:66",
12 "xosIpAddress" : "10.11.10.1",
13 "xosRestPort" : "9999",
14 "hosts" : {
15EOF
16
17NODES=$( sudo bash -c "source $SETUPDIR/admin-openrc.sh ; nova hypervisor-list" |grep -v ID|grep -v +|awk '{print $4}' )
18
19NODECOUNT=0
20for NODE in $NODES; do
21 ((NODECOUNT++))
22done
23
24I=0
25for NODE in $NODES; do
26 echo $NODE
27 ((I++))
28 if [[ "$I" -lt "$NODECOUNT" ]]; then
29 echo " \"$NODE\" : \"of:0000000000000001/1\"," >> $FN
30 else
31 echo " \"$NODE\" : \"of:0000000000000001/1\"" >> $FN
32 fi
33done
34
35cat >> $FN <<EOF
36 }
37}
38EOF