Thomas Vachuska
Committed by Brian O'Connor

Fixed onos-form-cluster in tar-setup scenario.

Change-Id: I5c3cb42d644b7004516393fbe67fb9e2b30fac6e
...@@ -6,28 +6,15 @@ ...@@ -6,28 +6,15 @@
6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 . $ONOS_ROOT/tools/build/envDefaults 7 . $ONOS_ROOT/tools/build/envDefaults
8 8
9 -ip=${1:-$OCI} 9 +node=${1:-$OCI}
10 10
11 -if [ $ip = "cell" ]; then 11 +if [ $node = "cell" ]; then
12 - ip=$OC1 12 + nodes=$(env | grep "OC[0-9]*=" | cut -d= -f2)
13 - nodes=$(env | grep "OC[0-9]*=" | grep -v "OC1=" | cut -d= -f2) 13 + node=${OCI}
14 else 14 else
15 - shift 15 + nodes="$@"
16 - nodes=$*
17 fi 16 fi
18 17
19 -ipPrefix=${ip%.*} 18 +set -x
20 19
21 -aux=/tmp/${ipPrefix}.cluster.json
22 -trap "rm -f $aux" EXIT
23 -
24 -echo "{ \"nodes\": [ { \"ip\": \"$ip\" }" > $aux
25 -for node in $nodes; do
26 - echo ", { \"ip\": \"$node\" }" >> $aux
27 -done
28 -echo "], \"ipPrefix\": \"$ipPrefix.*\" }" >> $aux
29 -
30 -for node in $ip $nodes; do
31 - echo "Forming cluster on $node..."
32 - curl -X POST http://$node:8181/onos/v1/cluster/configuration -d @$aux
33 -done
...\ No newline at end of file ...\ No newline at end of file
20 +ssh $ONOS_USER@$node /tmp/$ONOS_BITS/bin/onos-form-cluster $nodes
...\ No newline at end of file ...\ No newline at end of file
......