Merge "enable quantum multi-node scenarios."
diff --git a/AUTHORS b/AUTHORS
index bca25b4..f9aa9ea 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -17,7 +17,9 @@
 Jason Cannavale <jason.cannavale@rackspace.com>
 Jay Pipes <jaypipes@gmail.com>
 Jesse Andrews <anotherjesse@gmail.com>
+Joe Gordon <jogo@cloudscaling.com>
 Johannes Erdfelt <johannes.erdfelt@rackspace.com>
+John Postlethwait <john.postlethwait@nebula.com>
 Josh Kearney <josh@jk0.org>
 Justin Shepherd <galstrom21@gmail.com>
 Ken Pepple <ken.pepple@rabbityard.com>
diff --git a/files/apts/horizon b/files/apts/horizon
index d93c34b..9b1c9ee 100644
--- a/files/apts/horizon
+++ b/files/apts/horizon
@@ -22,3 +22,4 @@
 python-django-nose
 python-django-registration
 python-migrate
+nodejs
diff --git a/files/apts/nova b/files/apts/nova
index 3ebf57c..c16a708 100644
--- a/files/apts/nova
+++ b/files/apts/nova
@@ -19,7 +19,7 @@
 vlan
 curl
 rabbitmq-server # NOPRIME
-qpidd # NOPRIME
+qpidd # dist:precise NOPRIME
 socat # used by ajaxterm
 python-mox
 python-paste
diff --git a/files/swift/proxy-server.conf b/files/swift/proxy-server.conf
index ce5473b..84bf9cd 100644
--- a/files/swift/proxy-server.conf
+++ b/files/swift/proxy-server.conf
@@ -23,8 +23,6 @@
 # username and password.
 [filter:s3token]
 paste.filter_factory = keystone.middleware.s3_token:filter_factory
-service_port = %KEYSTONE_SERVICE_PORT%
-service_host = %KEYSTONE_SERVICE_HOST%
 auth_port = %KEYSTONE_AUTH_PORT%
 auth_host = %KEYSTONE_AUTH_HOST%
 auth_protocol = %KEYSTONE_AUTH_PROTOCOL%
@@ -42,7 +40,7 @@
 admin_password = %SERVICE_PASSWORD%
 
 [filter:swift3]
-use = egg:swift#swift3
+use = egg:swift3#middleware
 
 [filter:tempauth]
 use = egg:swift#tempauth
diff --git a/stack.sh b/stack.sh
index fea9255..930a1bf 100755
--- a/stack.sh
+++ b/stack.sh
@@ -214,6 +214,7 @@
 OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
 NOVNC_DIR=$DEST/noVNC
 SWIFT_DIR=$DEST/swift
+SWIFT3_DIR=$DEST/swift3
 QUANTUM_DIR=$DEST/quantum
 QUANTUM_CLIENT_DIR=$DEST/python-quantumclient
 MELANGE_DIR=$DEST/melange
@@ -673,6 +674,7 @@
 if is_service_enabled swift; then
     # storage service
     git_clone $SWIFT_REPO $SWIFT_DIR $SWIFT_BRANCH
+    git_clone $SWIFT3_REPO $SWIFT3_DIR $SWIFT3_BRANCH
 fi
 if is_service_enabled g-api n-api; then
     # image catalog service
@@ -716,6 +718,7 @@
 fi
 if is_service_enabled swift; then
     cd $SWIFT_DIR; sudo python setup.py develop
+    cd $SWIFT3_DIR; sudo python setup.py develop
 fi
 if is_service_enabled g-api n-api; then
     cd $GLANCE_DIR; sudo python setup.py develop
@@ -1360,16 +1363,20 @@
     sudo chown -R $USER:${USER_GROUP} ${SWIFT_DATA_DIR}
 
     # We then create a loopback disk and format it to XFS.
-    # TODO: Reset disks on new pass.
-    if [[ ! -e ${SWIFT_DATA_DIR}/drives/images/swift.img ]]; then
+    if [[ -e ${SWIFT_DATA_DIR}/drives/images/swift.img ]]; then
+        if egrep -q ${SWIFT_DATA_DIR}/drives/sdb1 /proc/mounts; then
+            sudo umount ${SWIFT_DATA_DIR}/drives/sdb1
+        fi
+    else
         mkdir -p  ${SWIFT_DATA_DIR}/drives/images
         sudo touch  ${SWIFT_DATA_DIR}/drives/images/swift.img
         sudo chown $USER: ${SWIFT_DATA_DIR}/drives/images/swift.img
 
         dd if=/dev/zero of=${SWIFT_DATA_DIR}/drives/images/swift.img \
             bs=1024 count=0 seek=${SWIFT_LOOPBACK_DISK_SIZE}
-        mkfs.xfs -f -i size=1024  ${SWIFT_DATA_DIR}/drives/images/swift.img
     fi
+    # Make a fresh XFS filesystem
+    mkfs.xfs -f -i size=1024  ${SWIFT_DATA_DIR}/drives/images/swift.img
 
     # After the drive being created we mount the disk with a few mount
     # options to make it most efficient as possible for swift.
@@ -1439,8 +1446,6 @@
        s,%SERVICE_PASSWORD%,$SERVICE_PASSWORD,g;
        s,%KEYSTONE_SERVICE_PROTOCOL%,$KEYSTONE_SERVICE_PROTOCOL,g;
        s,%SERVICE_TOKEN%,${SERVICE_TOKEN},g;
-       s,%KEYSTONE_SERVICE_PORT%,${KEYSTONE_SERVICE_PORT},g;
-       s,%KEYSTONE_SERVICE_HOST%,${KEYSTONE_SERVICE_HOST},g;
        s,%KEYSTONE_API_PORT%,${KEYSTONE_API_PORT},g;
        s,%KEYSTONE_AUTH_HOST%,${KEYSTONE_AUTH_HOST},g;
        s,%KEYSTONE_AUTH_PORT%,${KEYSTONE_AUTH_PORT},g;
@@ -1667,11 +1672,11 @@
 add_nova_opt "api_paste_config=$NOVA_CONF_DIR/api-paste.ini"
 add_nova_opt "image_service=nova.image.glance.GlanceImageService"
 add_nova_opt "ec2_dmz_host=$EC2_DMZ_HOST"
-if is_service_enabled rabbit ; then
+if is_service_enabled qpid ; then
+    add_nova_opt "rpc_backend=nova.rpc.impl_qpid"
+elif [ -n "$RABBIT_HOST" ] &&  [ -n "$RABBIT_PASSWORD" ]; then
     add_nova_opt "rabbit_host=$RABBIT_HOST"
     add_nova_opt "rabbit_password=$RABBIT_PASSWORD"
-elif is_service_enabled qpid ; then
-    add_nova_opt "rpc_backend=nova.rpc.impl_qpid"
 fi
 add_nova_opt "glance_api_servers=$GLANCE_HOSTPORT"
 add_nova_opt "force_dhcp_release=True"
diff --git a/stackrc b/stackrc
index 41a399a..98e6bd4 100644
--- a/stackrc
+++ b/stackrc
@@ -16,6 +16,9 @@
 # storage service
 SWIFT_REPO=https://github.com/openstack/swift.git
 SWIFT_BRANCH=master
+SWIFT3_REPO=https://github.com/fujita/swift3.git
+SWIFT3_BRANCH=master
+
 
 # image catalog service
 GLANCE_REPO=https://github.com/openstack/glance.git