Allowing simple cell definitions to work with new cell specs with separate Atomix and ONOS clusters.
Change-Id: Ib96090d0148f4ec3e37fa24061715815e249d988
diff --git a/tools/dev/bash_profile b/tools/dev/bash_profile
index 8ae6b47..985ed13 100644
--- a/tools/dev/bash_profile
+++ b/tools/dev/bash_profile
@@ -175,6 +175,17 @@
# Sets the primary instance to the specified instance number.
function setPrimaryInstance {
export ONOS_INSTANCES=$(env | grep 'OC[0-9]*=' | sort | cut -d= -f2)
+
+ if [ -z "$OCC1" ]; then
+ aux=/tmp/cell-$$.aux
+ let i=1
+ for n in $ONOS_INSTANCES; do
+ echo "export OCC$i=$n" >> $aux
+ let i=i+1
+ done
+ [ -f $aux ] && source $aux && rm $aux
+ fi
+
export ONOS_CORES=$(env | grep 'OCC[0-9]*=' | sort | cut -d= -f2)
export OCI=$(env | egrep "OC[0-9]+" | sort | egrep OC${1:-1} | cut -d= -f2)
echo $OCI