blob: 8eb971b64d861033bc5d9634e716ae8bd1d34d59 [file] [log] [blame]
Andy Bavier5bdf7052016-01-05 16:17:14 -05001FN=$SETUPDIR/virtualbng.json
Scott Baker3b47c5f2015-12-02 20:00:20 -08002
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
Andy Bavier5bdf7052016-01-05 16:17:14 -050017NODES=$( sudo bash -c "source $SETUPDIR/admin-openrc.sh ; nova hypervisor-list" |grep enabled|awk '{print $4}' )
Scott Baker3b47c5f2015-12-02 20:00:20 -080018
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