Merge pull request #99 from cloudbuilders/fix_nbd_connect

Fix issue #98 - wait till nbd is connected using method in nova's disk.py
diff --git a/exercise.sh b/exercise.sh
index 7a1ed9b..b73d6aa 100755
--- a/exercise.sh
+++ b/exercise.sh
@@ -123,7 +123,7 @@
 nova add-floating-ip $NAME $FLOATING_IP
 
 # sleep for a smidge
-sleep 1
+sleep 5
 
 # ping our floating ip
 ping -c1 -w1 $FLOATING_IP
@@ -132,7 +132,7 @@
 nova secgroup-delete-rule $SECGROUP icmp -1 -1 0.0.0.0/0
 
 # sleep for a smidge
-sleep 1
+sleep 5
 
 # ping our floating ip
 if ( ping -c1 -w1 $FLOATING_IP ); then
diff --git a/stack.sh b/stack.sh
index 18206cd..b093616 100755
--- a/stack.sh
+++ b/stack.sh
@@ -603,6 +603,7 @@
 fi
 if [ -n "$MULTI_HOST" ]; then
     add_nova_flag "--multi_host=$MULTI_HOST"
+    add_nova_flag "--send_arp_for_ha=1"
 fi
 
 # Nova Database
@@ -740,8 +741,8 @@
 
     for image_url in ${IMAGE_URLS//,/ }; do
         # Downloads the image (uec ami+aki style), then extracts it.
-        IMAGE_FNAME=`echo "$image_url" | python -c "import sys; print sys.stdin.read().split('/')[-1]"`
-        IMAGE_NAME=`echo "$IMAGE_FNAME" | python -c "import sys; print sys.stdin.read().split('.tar.gz')[0].split('.tgz')[0]"`
+        IMAGE_FNAME=`basename "$image_url"`
+        IMAGE_NAME=`basename "$IMAGE_FNAME" .tar.gz`
         if [ ! -f $FILES/$IMAGE_FNAME ]; then
             wget -c $image_url -O $FILES/$IMAGE_FNAME
         fi