Merge pull request #157 from cloudbuilders/swift-config-location

change swift config location to SWIFT_DIR/config
diff --git a/exercise.sh b/exercise.sh
index c49f124..77d3a3b 100755
--- a/exercise.sh
+++ b/exercise.sh
@@ -192,21 +192,23 @@
 # make sure that we can describe instances
 euca-describe-instances
 
-# Testing Swift
-# =============
+if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
+    # Testing Swift
+    # =============
 
-# Check if we have to swift via keystone
-swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD stat
+    # Check if we have to swift via keystone
+    swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD stat
 
-# We start by creating a test container
-swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD post testcontainer
+    # We start by creating a test container
+    swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD post testcontainer
 
-# add some files into it.
-swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD upload testcontainer /etc/issue
+    # add some files into it.
+    swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD upload testcontainer /etc/issue
 
-# list them
-swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD list testcontainer 
+    # list them
+    swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD list testcontainer 
 
-# And we may want to delete them now that we have tested that
-# everything works.
-swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD delete testcontainer
+    # And we may want to delete them now that we have tested that
+    # everything works.
+    swift --auth-version 2 -A http://${HOST_IP}:5000/v2.0 -U admin -K $ADMIN_PASSWORD delete testcontainer
+fi
diff --git a/stack.sh b/stack.sh
index 4d97e8d..976872a 100755
--- a/stack.sh
+++ b/stack.sh
@@ -317,9 +317,13 @@
 # By default we define 9 for the partition count (which mean 512).
 SWIFT_PARTITION_POWER_SIZE=${SWIFT_PARTITION_POWER_SIZE:-9}
 
-# SWIFT_HASH is a random unique string for a swift cluster that can never change.
-read_password SWIFT_HASH "ENTER A RANDOM SWIFT HASH."
-
+# We only ask for Swift Hash if we have enabled swift service.
+if [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
+    # SWIFT_HASH is a random unique string for a swift cluster that
+    # can never change.
+    read_password SWIFT_HASH "ENTER A RANDOM SWIFT HASH."
+fi
+    
 # Keystone
 # --------
 
@@ -359,7 +363,7 @@
 
 # install apt requirements
 apt_get update
-apt_get install `cat $FILES/apts/* | cut -d\# -f1 | grep -Ev "mysql-server|rabbitmq-server"`
+apt_get install `cat $FILES/apts/* | cut -d\# -f1 | grep -Ev "mysql-server|rabbitmq-server|memcached"`
 
 # install python requirements
 sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $FILES/pips/*`
diff --git a/tools/build_libvirt.sh b/tools/build_libvirt.sh
index fc281d3..3de8cc5 100755
--- a/tools/build_libvirt.sh
+++ b/tools/build_libvirt.sh
@@ -145,7 +145,7 @@
 # Make sure that base requirements are installed
 cp /etc/resolv.conf $COPY_DIR/etc/resolv.conf
 chroot $COPY_DIR apt-get update
-chroot $COPY_DIR apt-get install -y --force-yes `cat files/apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"`
+chroot $COPY_DIR apt-get install -y --force-yes `cat files/apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server|memcached)"`
 chroot $COPY_DIR apt-get install -y --download-only rabbitmq-server libvirt-bin mysql-server
 chroot $COPY_DIR pip install `cat files/pips/*`
 
diff --git a/tools/build_lxc.sh b/tools/build_lxc.sh
index a2c5a22..13b98df 100755
--- a/tools/build_lxc.sh
+++ b/tools/build_lxc.sh
@@ -125,7 +125,7 @@
 
 # Make sure that base requirements are installed
 chroot $CACHEDIR apt-get update
-chroot $CACHEDIR apt-get install -y --force-yes `cat files/apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server)"`
+chroot $CACHEDIR apt-get install -y --force-yes `cat files/apts/* | cut -d\# -f1 | egrep -v "(rabbitmq|libvirt-bin|mysql-server|memcached)"`
 chroot $CACHEDIR apt-get install -y --download-only rabbitmq-server libvirt-bin mysql-server
 chroot $CACHEDIR pip install `cat files/pips/*`