Merge "Fix test that checks whether insances from previous runs need to be removed"
diff --git a/AUTHORS b/AUTHORS
index 84a565e..34e0474 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -10,6 +10,7 @@
 Jason Cannavale <jason.cannavale@rackspace.com>
 Jay Pipes <jaypipes@gmail.com>
 Jesse Andrews <anotherjesse@gmail.com>
+Johannes Erdfelt <johannes.erdfelt@rackspace.com>
 Justin Shepherd <galstrom21@gmail.com>
 Kiall Mac Innes <kiall@managedit.ie>
 Scott Moser <smoser@ubuntu.com>
diff --git a/files/keystone.conf b/files/keystone.conf
index a646513..6d0fd7e 100644
--- a/files/keystone.conf
+++ b/files/keystone.conf
@@ -64,7 +64,7 @@
 cert_required = True
 
 #Role that allows to perform admin operations.
-keystone-admin-role = Admin
+keystone-admin-role = admin
 
 #Role that allows to perform service admin operations.
 keystone-service-admin-role = KeystoneServiceAdmin
diff --git a/files/keystone_data.sh b/files/keystone_data.sh
index 818919c..77f6b93 100755
--- a/files/keystone_data.sh
+++ b/files/keystone_data.sh
@@ -10,19 +10,19 @@
 $BIN_DIR/keystone-manage user add demo %ADMIN_PASSWORD%
 
 # Roles
-$BIN_DIR/keystone-manage role add Admin
+$BIN_DIR/keystone-manage role add admin
 $BIN_DIR/keystone-manage role add Member
 $BIN_DIR/keystone-manage role add KeystoneAdmin
 $BIN_DIR/keystone-manage role add KeystoneServiceAdmin
 $BIN_DIR/keystone-manage role add sysadmin
 $BIN_DIR/keystone-manage role add netadmin
-$BIN_DIR/keystone-manage role grant Admin admin admin
+$BIN_DIR/keystone-manage role grant admin admin admin
 $BIN_DIR/keystone-manage role grant Member demo demo
 $BIN_DIR/keystone-manage role grant sysadmin demo demo
 $BIN_DIR/keystone-manage role grant netadmin demo demo
 $BIN_DIR/keystone-manage role grant Member demo invisible_to_admin
-$BIN_DIR/keystone-manage role grant Admin admin demo
-$BIN_DIR/keystone-manage role grant Admin admin
+$BIN_DIR/keystone-manage role grant admin admin demo
+$BIN_DIR/keystone-manage role grant admin admin
 $BIN_DIR/keystone-manage role grant KeystoneAdmin admin
 $BIN_DIR/keystone-manage role grant KeystoneServiceAdmin admin
 
diff --git a/files/nova-api-paste.ini b/files/nova-api-paste.ini
deleted file mode 100644
index 76c8aae..0000000
--- a/files/nova-api-paste.ini
+++ /dev/null
@@ -1,20 +0,0 @@
-##########
-# Extras #
-##########
-
-[filter:keystonecontext]
-paste.filter_factory = keystone.middleware.nova_keystone_context:NovaKeystoneContext.factory
-
-[filter:totoken]
-paste.filter_factory = keystone.middleware.ec2_token:EC2Token.factory
-
-[filter:authtoken]
-paste.filter_factory = keystone.middleware.auth_token:filter_factory
-service_protocol = http
-service_host = 127.0.0.1
-service_port = 5000
-auth_host = 127.0.0.1
-auth_port = 35357
-auth_protocol = http
-auth_uri = http://127.0.0.1:5000/
-admin_token = %SERVICE_TOKEN%
diff --git a/files/pips/horizon b/files/pips/horizon
index 893efb7..44bf6db 100644
--- a/files/pips/horizon
+++ b/files/pips/horizon
@@ -1,4 +1,2 @@
 django-nose-selenium
 pycrypto==2.3
-
--e git+https://github.com/jacobian/openstack.compute.git#egg=openstack
diff --git a/stack.sh b/stack.sh
index 5e05956..d6a7869 100755
--- a/stack.sh
+++ b/stack.sh
@@ -834,7 +834,7 @@
     # the configuration required for nova to validate keystone tokens.
 
     # First we add a some extra data to the default paste config from nova
-    cat $NOVA_DIR/etc/nova/api-paste.ini $FILES/nova-api-paste.ini > $NOVA_DIR/bin/nova-api-paste.ini
+    cp $NOVA_DIR/etc/nova/api-paste.ini $NOVA_DIR/bin/nova-api-paste.ini
 
     # Then we add our own service token to the configuration
     sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" -i $NOVA_DIR/bin/nova-api-paste.ini
@@ -843,11 +843,10 @@
     function replace_pipeline() {
         sed "/\[pipeline:$1\]/,/\[/s/^pipeline = .*/pipeline = $2/" -i $NOVA_DIR/bin/nova-api-paste.ini
     }
-    replace_pipeline "ec2cloud" "ec2faultwrap logrequest totoken authtoken keystonecontext cloudrequest authorizer ec2executor"
+    replace_pipeline "ec2cloud" "ec2faultwrap logrequest totoken authtoken keystonecontext cloudrequest authorizer validator ec2executor"
     replace_pipeline "ec2admin" "ec2faultwrap logrequest totoken authtoken keystonecontext adminrequest authorizer ec2executor"
-    replace_pipeline "openstack_api_v2" "faultwrap authtoken keystonecontext ratelimit serialize extensions osapi_app_v2"
-    replace_pipeline "openstack_compute_api_v2" "faultwrap authtoken keystonecontext ratelimit serialize compute_extensions osapi_compute_app_v2"
-    replace_pipeline "openstack_volume_api_v1" "faultwrap authtoken keystonecontext ratelimit serialize volume_extensions osapi_volume_app_v1"
+    replace_pipeline "openstack_compute_api_v2" "faultwrap authtoken keystonecontext ratelimit osapi_compute_app_v2"
+    replace_pipeline "openstack_volume_api_v1" "faultwrap authtoken keystonecontext ratelimit osapi_volume_app_v1"
 fi
 
 # Helper to clean iptables rules
@@ -1228,6 +1227,7 @@
     XEN_FIREWALL_DRIVER=${XEN_FIREWALL_DRIVER:-"nova.virt.firewall.IptablesFirewallDriver"}
     add_nova_flag "--firewall_driver=$XEN_FIREWALL_DRIVER"
 else
+    add_nova_flag "--connection_type=libvirt"
     add_nova_flag "--flat_network_bridge=$FLAT_NETWORK_BRIDGE"
     if [ -n "$FLAT_INTERFACE" ]; then
         add_nova_flag "--flat_interface=$FLAT_INTERFACE"
@@ -1365,6 +1365,7 @@
         apt_get install openvswitch-switch openvswitch-datapath-dkms
         # Create database for the plugin/agent
         if [[ "$ENABLED_SERVICES" =~ "mysql" ]]; then
+            mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'DROP DATABASE IF EXISTS ovs_quantum;'
             mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e 'CREATE DATABASE IF NOT EXISTS ovs_quantum;'
         else
             echo "mysql must be enabled in order to use the $Q_PLUGIN Quantum plugin."