Thomas Vachuska
Committed by Gerrit Code Review

Fixing onos-setup-karaf to always generate tablets.json and cluster.json config …

…files without having to specify 'clean' option.

Change-Id: I23b4d86fb5bdfd5e93a0d7fa8e18de8ecdbc2bee
...@@ -94,19 +94,17 @@ if [ ! -f $KARAF_ROOT/lib/onos-branding-$ONOS_POM_VERSION.jar ]; then ...@@ -94,19 +94,17 @@ if [ ! -f $KARAF_ROOT/lib/onos-branding-$ONOS_POM_VERSION.jar ]; then
94 $KARAF_ROOT/lib 94 $KARAF_ROOT/lib
95 fi 95 fi
96 96
97 -if [ ! -d $STAGE/config ]; then 97 +echo "Creating local cluster configs for IP $IP..."
98 - echo "Creating local cluster configs for IP $IP..." 98 +[ -d $STAGE/config ] || mkdir -p $STAGE/config
99 - mkdir -p $STAGE/config 99 +cat > $STAGE/config/cluster.json <<EOF
100 - cat > $STAGE/config/cluster.json <<EOF
101 { "ipPrefix": "$SUBNET.*", 100 { "ipPrefix": "$SUBNET.*",
102 "nodes":[ { "id": "$IP", "ip": "$IP", "tcpPort": 9876 }]} 101 "nodes":[ { "id": "$IP", "ip": "$IP", "tcpPort": 9876 }]}
103 EOF 102 EOF
104 103
105 - cat > $STAGE/config/tablets.json <<EOF 104 +cat > $STAGE/config/tablets.json <<EOF
106 { "nodes": [ { "ip": "$IP", "id": "$IP", "tcpPort": 7238 }], 105 { "nodes": [ { "ip": "$IP", "id": "$IP", "tcpPort": 7238 }],
107 "partitions": { "p1": [ { "ip": "$IP", "id": "$IP", "tcpPort": 7238 }]}} 106 "partitions": { "p1": [ { "ip": "$IP", "id": "$IP", "tcpPort": 7238 }]}}
108 EOF 107 EOF
109 -fi
110 108
111 echo "Setting up hazelcast.xml for subnet $SUBNET.*..." 109 echo "Setting up hazelcast.xml for subnet $SUBNET.*..."
112 cp $ONOS_ROOT/tools/package/etc/hazelcast.xml $KARAF_ROOT/etc/hazelcast.xml 110 cp $ONOS_ROOT/tools/package/etc/hazelcast.xml $KARAF_ROOT/etc/hazelcast.xml
......