Fixed onos-form-cluster in tar-setup scenario.
Change-Id: I5c3cb42d644b7004516393fbe67fb9e2b30fac6e
diff --git a/tools/test/bin/onos-form-cluster b/tools/test/bin/onos-form-cluster
index ea50968..f1d3429 100755
--- a/tools/test/bin/onos-form-cluster
+++ b/tools/test/bin/onos-form-cluster
@@ -6,28 +6,15 @@
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
-ip=${1:-$OCI}
+node=${1:-$OCI}
-if [ $ip = "cell" ]; then
- ip=$OC1
- nodes=$(env | grep "OC[0-9]*=" | grep -v "OC1=" | cut -d= -f2)
+if [ $node = "cell" ]; then
+ nodes=$(env | grep "OC[0-9]*=" | cut -d= -f2)
+ node=${OCI}
else
- shift
- nodes=$*
+ nodes="$@"
fi
-ipPrefix=${ip%.*}
+set -x
-aux=/tmp/${ipPrefix}.cluster.json
-trap "rm -f $aux" EXIT
-
-echo "{ \"nodes\": [ { \"ip\": \"$ip\" }" > $aux
-for node in $nodes; do
- echo ", { \"ip\": \"$node\" }" >> $aux
-done
-echo "], \"ipPrefix\": \"$ipPrefix.*\" }" >> $aux
-
-for node in $ip $nodes; do
- echo "Forming cluster on $node..."
- curl -X POST http://$node:8181/onos/v1/cluster/configuration -d @$aux
-done
\ No newline at end of file
+ssh $ONOS_USER@$node /tmp/$ONOS_BITS/bin/onos-form-cluster $nodes
\ No newline at end of file