Merge branch 'toddexercises' of github.com:cloudbuilders/devstack into toddexercises
diff --git a/exercise.sh b/exercise.sh
index d776385..7703f40 100755
--- a/exercise.sh
+++ b/exercise.sh
@@ -8,7 +8,7 @@
 
 # Locate the scripts we should run
 EXERCISE_DIR=$(dirname "$0")/exercises
-basenames=$(for b in `ls $EXERCISE_DIR/*.sh` ; do basename $b .sh ; done)
+basenames=$(for b in `ls $EXERCISE_DIR/*.sh`; do basename $b .sh; done)
 
 # Track the state of each script
 passes=""
@@ -16,7 +16,7 @@
 skips=""
 
 # Loop over each possible script (by basename)
-for script in $basenames ; do
+for script in $basenames; do
     if [[ "$SKIP_EXERCISES" =~ $script ]] ; then
         skips="$skips $script"
     else
@@ -35,12 +35,12 @@
 # output status of exercise run
 echo =========================
 echo =========================
-for script in $skips ; do
+for script in $skips; do
     echo SKIP $script
 done
-for script in $passes ; do
+for script in $passes; do
     echo PASS $script
 done
-for script in $failures ; do
+for script in $failures; do
     echo FAILED $script
 done
diff --git a/exercises/euca.sh b/exercises/euca.sh
index bf6910d..9605ace 100755
--- a/exercises/euca.sh
+++ b/exercises/euca.sh
@@ -28,8 +28,8 @@
 INSTANCE=`euca-run-instances $IMAGE | grep INSTANCE | cut -f2`
 
 # assure it has booted within a reasonable time
-if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then
-    echo "server didn't become active within $BOOT_TIMEOUT seconds"
+if ! timeout $RUNNING_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then
+    echo "server didn't become active within $RUNNING_TIMEOUT seconds"
     exit 1
 fi
 
diff --git a/openrc b/openrc
index db1a7d1..4b36112 100644
--- a/openrc
+++ b/openrc
@@ -55,5 +55,8 @@
 # Max time to wait while vm goes from build to active state
 export ACTIVE_TIMEOUT=${ACTIVE_TIMEOUT:-10}
 
+# Max time from run instance command until it is running
+export RUNNING_TIMEOUT=${RUNNING_TIMEOUT:-$(($BOOT_TIMEOUT + $ACTIVE_TIMEOUT))}
+
 # Max time to wait for proper IP association and dis-association.
 export ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-10}