Claudine Chiu

ONOS-737: regexp for grabbing OC* variables changed

Change-Id: Id5651ffb41230a39c6ed68e1605feaf3c0aa337b
......@@ -8,7 +8,7 @@ set -e
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
onos-package && stc prerequisites && stc setup
......
......@@ -30,7 +30,7 @@ fi
# Select the target
if [ "${1}" = "--cell" ]; then
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
else
nodes=${1:-$OCI}
fi
......
......@@ -6,7 +6,7 @@
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
for node in $nodes; do
echo "fetching from ${node}..."
......
......@@ -4,7 +4,7 @@
#-------------------------------------------------------------------------------
cellName=$ONOS_CELL
nodeCount=$(env | egrep "OC[0-9]+" | wc -l | tr -d ' ')
nodeCount=$(env | egrep "^OC[0-9]+" | wc -l | tr -d ' ')
osascript -e "
tell application \"iTerm\"
......
......@@ -4,7 +4,7 @@
#-------------------------------------------------------------------------------
cellName=$ONOS_CELL
nodeCount=$(env | egrep "OC[0-9]+" | wc -l | tr -d ' ')
nodeCount=$(env | egrep "^OC[0-9]+" | wc -l | tr -d ' ')
osascript -e "
tell application \"iTerm\"
......
......@@ -14,7 +14,7 @@ shift
echo "Pushing to proxy $node..."
onos-push-bits $node
others=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2 | grep -vE "^$OCT\$")
others=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2 | grep -vE "^$OCT\$")
for other in $others; do
echo "Pushing to $other..."
......
......@@ -15,7 +15,7 @@ bundle=$(echo $(basename $jar .jar) | sed 's/-[0-9].*//g')
echo "pushing bundle: $bundle"
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
for node in $nodes; do
scp -q $jar $ONOS_USER@$node:.m2/repository/$jar
scp -q $jar $ONOS_USER@$node:$ONOS_INSTALL_DIR/$KARAF_DIST/system/$jar
......
......@@ -6,7 +6,7 @@
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
onos-service --cell stop
......
......@@ -17,7 +17,7 @@ password=${password:-$user} # password defaults to the user if not specified
let OPC=$OPTIND-1
shift $OPC
nodes=${1:-$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)}
nodes=${1:-$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)}
for node in $nodes; do
# Prune the node entry from the known hosts file since server key changes
......
......@@ -36,7 +36,7 @@ case $2 in
start|stop|restart|status)
# Select the target
if [ "${1}" = "--cell" ]; then
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
else
nodes=$(find_node ${1:-$OCI})
fi
......
......@@ -43,7 +43,7 @@ fi
echo "ONOS_CELL=${ONOS_CELL}"
echo "ONOS_NIC=${ONOS_NIC}"
# get number of OC variables
max=$( env | egrep 'OC[0-9]+' | wc -l )
max=$( env | egrep '^OC[0-9]+' | wc -l )
for n in $( seq 0 ${max} ); do
ocn="OC${n}"
if [ -n "${!ocn}" ]; then
......
......@@ -36,4 +36,4 @@ $SSHCMD -n $ONOS_USER@$OCN mkdir -p topos
$SCPCMD $ONOS_ROOT/tools/test/topos/* $ONOS_USER@$OCN:topos/
echo "Starting Network."
$SSHCMD -t $ONOS_USER@$OCN sudo python $topo $(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
$SSHCMD -t $ONOS_USER@$OCN sudo python $topo $(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
......
......@@ -8,7 +8,7 @@
echo "This facility has been deprecated and will be removed in 1.6.0 (Goldeneye) release!!!"
nodes=$(env | sort | egrep "OC[0-9]+" | cut -d= -f2)
nodes=$(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
for node in $nodes; do
printf "$node..."
......
......@@ -6,6 +6,6 @@
[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
. $ONOS_ROOT/tools/build/envDefaults
for node in $OCT $OCN $(env | sort | egrep "OC[0-9]+" | cut -d= -f2); do
for node in $OCT $OCN $(env | sort | egrep "^OC[0-9]+" | cut -d= -f2); do
printf "%s: " $node; ssh -n -o StrictHostKeyChecking=no -o PasswordAuthentication=no $ONOS_USER@$node hostname
done
......