Create exerciserc to configure exercises

* Move timeouts from openrc to (new) exerciserc
* Update all exercise scripts
* Update HACKING.rst

Fixes bug 951315

Change-Id: Icc4ff03a7dcf0cc711e204046176fb5186990c17
diff --git a/exercises/bundle.sh b/exercises/bundle.sh
index 47bacac..0f128af 100755
--- a/exercises/bundle.sh
+++ b/exercises/bundle.sh
@@ -28,6 +28,9 @@
 # Import EC2 configuration
 source $TOP_DIR/eucarc
 
+# Import exercise configuration
+source $TOP_DIR/exerciserc
+
 # Remove old certificates
 rm -f $TOP_DIR/cacert.pem
 rm -f $TOP_DIR/cert.pem
diff --git a/exercises/client-env.sh b/exercises/client-env.sh
index d4ba702..0f17275 100755
--- a/exercises/client-env.sh
+++ b/exercises/client-env.sh
@@ -22,6 +22,9 @@
 # Import configuration
 source $TOP_DIR/openrc
 
+# Import exercise configuration
+source $TOP_DIR/exerciserc
+
 # Unset all of the known NOVA_ vars
 unset NOVA_API_KEY
 unset NOVA_ENDPOINT_NAME
diff --git a/exercises/euca.sh b/exercises/euca.sh
index 2be2f62..703c7aa 100755
--- a/exercises/euca.sh
+++ b/exercises/euca.sh
@@ -28,14 +28,8 @@
 # Import EC2 configuration
 source $TOP_DIR/eucarc
 
-# Max time to wait while vm goes from build to active state
-ACTIVE_TIMEOUT=${ACTIVE_TIMEOUT:-30}
-
-# Max time till the vm is bootable
-BOOT_TIMEOUT=${BOOT_TIMEOUT:-30}
-
-# Max time to wait for proper association and dis-association.
-ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-15}
+# Import exercise configuration
+source $TOP_DIR/exerciserc
 
 # Instance type to create
 DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny}
diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh
index a47f1ff..f2b9d03 100755
--- a/exercises/floating_ips.sh
+++ b/exercises/floating_ips.sh
@@ -23,24 +23,18 @@
 # Settings
 # ========
 
-# Use openrc + stackrc + localrc for settings
-pushd $(cd $(dirname "$0")/.. && pwd) >/dev/null
+# Keep track of the current directory
+EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
+TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)
 
 # Import common functions
-source ./functions
+source $TOP_DIR/functions
 
 # Import configuration
-source ./openrc
-popd >/dev/null
+source $TOP_DIR/openrc
 
-# Max time to wait while vm goes from build to active state
-ACTIVE_TIMEOUT=${ACTIVE_TIMEOUT:-30}
-
-# Max time till the vm is bootable
-BOOT_TIMEOUT=${BOOT_TIMEOUT:-30}
-
-# Max time to wait for proper association and dis-association.
-ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-15}
+# Import exercise configuration
+source $TOP_DIR/exerciserc
 
 # Instance type to create
 DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny}
diff --git a/exercises/swift.sh b/exercises/swift.sh
index 7609637..b70b85f 100755
--- a/exercises/swift.sh
+++ b/exercises/swift.sh
@@ -18,15 +18,18 @@
 # Settings
 # ========
 
-# Use openrc + stackrc + localrc for settings
-pushd $(cd $(dirname "$0")/.. && pwd) >/dev/null
+# Keep track of the current directory
+EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
+TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)
 
 # Import common functions
-source ./functions
+source $TOP_DIR/functions
 
 # Import configuration
-source ./openrc
-popd >/dev/null
+source $TOP_DIR/openrc
+
+# Import exercise configuration
+source $TOP_DIR/exerciserc
 
 # Container name
 CONTAINER=ex-swift
diff --git a/exercises/volumes.sh b/exercises/volumes.sh
index a812401..77c3498 100755
--- a/exercises/volumes.sh
+++ b/exercises/volumes.sh
@@ -18,24 +18,18 @@
 # Settings
 # ========
 
-# Use openrc + stackrc + localrc for settings
-pushd $(cd $(dirname "$0")/.. && pwd) >/dev/null
+# Keep track of the current directory
+EXERCISE_DIR=$(cd $(dirname "$0") && pwd)
+TOP_DIR=$(cd $EXERCISE_DIR/..; pwd)
 
 # Import common functions
-source ./functions
+source $TOP_DIR/functions
 
 # Import configuration
-source ./openrc
-popd >/dev/null
+source $TOP_DIR/openrc
 
-# Max time to wait while vm goes from build to active state
-ACTIVE_TIMEOUT=${ACTIVE_TIMEOUT:-30}
-
-# Max time till the vm is bootable
-BOOT_TIMEOUT=${BOOT_TIMEOUT:-30}
-
-# Max time to wait for proper association and dis-association.
-ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-15}
+# Import exercise configuration
+source $TOP_DIR/exerciserc
 
 # Instance type to create
 DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny}