Merge "Un-nest generate_swift_config"
diff --git a/clean.sh b/clean.sh
index 09f08dc..b2a9405 100755
--- a/clean.sh
+++ b/clean.sh
@@ -101,11 +101,6 @@
     cleanup_nova_hypervisor
 fi
 
-#if mount | grep $DATA_DIR/swift/drives; then
-#  sudo umount $DATA_DIR/swift/drives/sdb1
-#fi
-
-
 # Clean out /etc
 sudo rm -rf /etc/keystone /etc/glance /etc/nova /etc/cinder /etc/swift
 
@@ -123,9 +118,5 @@
     sudo rm -rf $SCREEN_LOGDIR
 fi
 
-# Clean up networking...
-# should this be in nova?
-# FIXED_IP_ADDR in br100
-
 # Clean up files
 rm -f $TOP_DIR/.stackenv
diff --git a/driver_certs/cinder_driver_cert.sh b/driver_certs/cinder_driver_cert.sh
index 99b2c8e..e45b7f8 100755
--- a/driver_certs/cinder_driver_cert.sh
+++ b/driver_certs/cinder_driver_cert.sh
@@ -16,6 +16,7 @@
 # It also assumes default install location (/opt/stack/xxx)
 # to aid in debug, you should also verify that you've added
 # an output directory for screen logs:
+#
 #     SCREEN_LOGDIR=/opt/stack/screen-logs
 
 CERT_DIR=$(cd $(dirname "$0") && pwd)
diff --git a/files/default_catalog.templates b/files/default_catalog.templates
index e64f68f..ff00e38 100644
--- a/files/default_catalog.templates
+++ b/files/default_catalog.templates
@@ -50,12 +50,12 @@
 catalog.RegionOne.cloudformation.publicURL = http://%SERVICE_HOST%:8000/v1
 catalog.RegionOne.cloudformation.adminURL = http://%SERVICE_HOST%:8000/v1
 catalog.RegionOne.cloudformation.internalURL = http://%SERVICE_HOST%:8000/v1
-catalog.RegionOne.cloudformation.name = Heat CloudFormation Service
+catalog.RegionOne.cloudformation.name = CloudFormation service
 
 catalog.RegionOne.orchestration.publicURL = http://%SERVICE_HOST%:8004/v1/$(tenant_id)s
 catalog.RegionOne.orchestration.adminURL = http://%SERVICE_HOST%:8004/v1/$(tenant_id)s
 catalog.RegionOne.orchestration.internalURL = http://%SERVICE_HOST%:8004/v1/$(tenant_id)s
-catalog.RegionOne.orchestration.name = Heat Service
+catalog.RegionOne.orchestration.name = Orchestration Service
 
 catalog.RegionOne.metering.publicURL = http://%SERVICE_HOST%:8777/v1
 catalog.RegionOne.metering.adminURL = http://%SERVICE_HOST%:8777/v1
diff --git a/files/rpms/cinder b/files/rpms/cinder
index 623c13e..199ae10 100644
--- a/files/rpms/cinder
+++ b/files/rpms/cinder
@@ -4,4 +4,4 @@
 python-devel
 postgresql-devel
 iscsi-initiator-utils
-python-lxml         #dist:f18,f19,f20
+python-lxml         #dist:f18,f19,f20,rhel7
diff --git a/files/rpms/glance b/files/rpms/glance
index fffd9c8..785ce25 100644
--- a/files/rpms/glance
+++ b/files/rpms/glance
@@ -9,8 +9,8 @@
 python-devel
 python-eventlet
 python-greenlet
-python-lxml         #dist:f18,f19,f20
-python-paste-deploy #dist:f18,f19,f20
+python-lxml         #dist:f18,f19,f20,rhel7
+python-paste-deploy #dist:f18,f19,f20,rhel7
 python-routes
 python-sqlalchemy
 python-wsgiref
diff --git a/files/rpms/neutron b/files/rpms/neutron
index 67bf523..42d7f68 100644
--- a/files/rpms/neutron
+++ b/files/rpms/neutron
@@ -11,8 +11,8 @@
 python-iso8601
 python-kombu
 #rhel6 gets via pip
-python-paste        # dist:f18,f19,f20
-python-paste-deploy # dist:f18,f19,f20
+python-paste        # dist:f18,f19,f20,rhel7
+python-paste-deploy # dist:f18,f19,f20,rhel7
 python-qpid
 python-routes
 python-sqlalchemy
diff --git a/files/rpms/nova b/files/rpms/nova
index ac70ac5..a607d92 100644
--- a/files/rpms/nova
+++ b/files/rpms/nova
@@ -28,11 +28,11 @@
 python-lockfile
 python-migrate
 python-mox
-python-paramiko # dist:f18,f19,f20
-# ^ on RHEL, brings in python-crypto which conflicts with version from
+python-paramiko # dist:f18,f19,f20,rhel7
+# ^ on RHEL6, brings in python-crypto which conflicts with version from
 # pip we need
-python-paste        # dist:f18,f19,f20
-python-paste-deploy # dist:f18,f19,f20
+python-paste        # dist:f18,f19,f20,rhel7
+python-paste-deploy # dist:f18,f19,f20,rhel7
 python-qpid
 python-routes
 python-sqlalchemy
diff --git a/files/rpms/swift b/files/rpms/swift
index 32432bc..72253f7 100644
--- a/files/rpms/swift
+++ b/files/rpms/swift
@@ -9,7 +9,7 @@
 python-greenlet
 python-netifaces
 python-nose
-python-paste-deploy # dist:f18,f19,f20
+python-paste-deploy # dist:f18,f19,f20,rhel7
 python-simplejson
 python-webob
 pyxattr
diff --git a/functions b/functions
index 5eae7fe..6979c6c 100644
--- a/functions
+++ b/functions
@@ -2,10 +2,15 @@
 #
 # The following variables are assumed to be defined by certain functions:
 #
+# - ``DATABASE_BACKENDS``
 # - ``ENABLED_SERVICES``
 # - ``FILES``
 # - ``GLANCE_HOSTPORT``
+# - ``REQUIREMENTS_DIR``
+# - ``STACK_USER``
 # - ``TRACK_DEPENDS``
+# - ``UNDO_REQUIREMENTS``
+#
 
 # Include the common functions
 FUNC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
@@ -45,7 +50,7 @@
 # Updates the dependencies in project_dir from the
 # openstack/requirements global list before installing anything.
 #
-# Uses globals ``TRACK_DEPENDS``, ``REQUIREMENTS_DIR``
+# Uses globals ``TRACK_DEPENDS``, ``REQUIREMENTS_DIR``, ``UNDO_REQUIREMENTS``
 # setup_develop directory
 function setup_develop() {
     local project_dir=$1
diff --git a/lib/apache b/lib/apache
index 8ae78b2..0e5712f 100644
--- a/lib/apache
+++ b/lib/apache
@@ -4,8 +4,8 @@
 # Dependencies:
 #
 # - ``functions`` file
-# -``STACK_USER`` must be defined
-
+# - ``STACK_USER`` must be defined
+#
 # lib/apache exports the following functions:
 #
 # - is_apache_enabled_service
diff --git a/lib/databases/mysql b/lib/databases/mysql
index 476b4b9..31e7163 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -25,7 +25,11 @@
         sudo rm -rf /var/lib/mysql
         return
     elif is_fedora; then
-        MYSQL=mysqld
+        if [[ $DISTRO =~ (rhel7) ]]; then
+            MYSQL=mariadb
+        else
+            MYSQL=mysqld
+        fi
     elif is_suse; then
         MYSQL=mysql
     else
@@ -48,8 +52,12 @@
         MY_CONF=/etc/mysql/my.cnf
         MYSQL=mysql
     elif is_fedora; then
+        if [[ $DISTRO =~ (rhel7) ]]; then
+            MYSQL=mariadb
+        else
+            MYSQL=mysqld
+        fi
         MY_CONF=/etc/my.cnf
-        MYSQL=mysqld
     elif is_suse; then
         MY_CONF=/etc/my.cnf
         MYSQL=mysql
@@ -135,7 +143,11 @@
     fi
     # Install mysql-server
     if is_ubuntu || is_fedora; then
-        install_package mysql-server
+        if [[ $DISTRO =~ (rhel7) ]]; then
+            install_package mariadb-server
+        else
+            install_package mysql-server
+        fi
     elif is_suse; then
         if ! is_package_installed mariadb; then
             install_package mysql-community-server
diff --git a/lib/heat b/lib/heat
index efb01ef..af10fa6 100644
--- a/lib/heat
+++ b/lib/heat
@@ -110,15 +110,6 @@
     iniset $HEAT_CONF ec2authtoken auth_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0
     iniset $HEAT_CONF ec2authtoken keystone_ec2_uri $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/ec2tokens
 
-    # stack user domain
-    # Note we have to pass token/endpoint here because the current endpoint and
-    # version negotiation in OSC means just --os-identity-api-version=3 won't work
-    KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3"
-    D_ID=$(openstack --os-token $OS_SERVICE_TOKEN --os-url=$KS_ENDPOINT_V3 \
-        --os-identity-api-version=3 domain show heat \
-        | grep ' id ' | get_field 2)
-    iniset $HEAT_CONF stack_user_domain ${D_ID}
-
     # paste_deploy
     [[ "$HEAT_STANDALONE" = "True" ]] && iniset $HEAT_CONF paste_deploy flavor standalone
 
@@ -211,9 +202,11 @@
     # Note we have to pass token/endpoint here because the current endpoint and
     # version negotiation in OSC means just --os-identity-api-version=3 won't work
     KS_ENDPOINT_V3="$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v3"
-    openstack --os-token $OS_SERVICE_TOKEN --os-url=$KS_ENDPOINT_V3 \
+    D_ID=$(openstack --os-token $OS_TOKEN --os-url=$KS_ENDPOINT_V3 \
         --os-identity-api-version=3 domain create heat \
-        --description "Owns users and projects created by heat"
+        --description "Owns users and projects created by heat" \
+        | grep ' id ' | get_field 2)
+    iniset $HEAT_CONF DEFAULT stack_user_domain ${D_ID}
 }
 
 # Restore xtrace
diff --git a/lib/marconi b/lib/marconi
index b6ce57a..1c8be49 100644
--- a/lib/marconi
+++ b/lib/marconi
@@ -2,7 +2,8 @@
 # Install and start **Marconi** service
 
 # To enable a minimal set of Marconi services, add the following to localrc:
-#   enable_service marconi-server
+#
+#     enable_service marconi-server
 #
 # Dependencies:
 # - functions
@@ -51,6 +52,11 @@
 MARCONICLIENT_REPO=${MARCONICLIENT_REPO:-${GIT_BASE}/openstack/python-marconiclient.git}
 MARCONICLIENT_BRANCH=${MARCONICLIENT_BRANCH:-master}
 
+# Set Marconi Connection Info
+MARCONI_SERVICE_HOST=${MARCONI_SERVICE_HOST:-$SERVICE_HOST}
+MARCONI_SERVICE_PORT=${MARCONI_SERVICE_PORT:-8888}
+MARCONI_SERVICE_PROTOCOL=${MARCONI_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
+
 # Tell Tempest this project is present
 TEMPEST_SERVICES+=,marconi
 
@@ -89,7 +95,7 @@
     sudo chown $USER $MARCONI_API_LOG_DIR
 
     iniset $MARCONI_CONF DEFAULT verbose True
-    iniset $MARCONI_CONF 'drivers:transport:wsgi' bind '0.0.0.0'
+    iniset $MARCONI_CONF 'drivers:transport:wsgi' bind $MARCONI_SERVICE_HOST
 
     iniset $MARCONI_CONF keystone_authtoken auth_protocol http
     iniset $MARCONI_CONF keystone_authtoken admin_user marconi
@@ -142,6 +148,10 @@
 # start_marconi() - Start running processes, including screen
 function start_marconi() {
     screen_it marconi-server "marconi-server --config-file $MARCONI_CONF"
+    echo "Waiting for Marconi to start..."
+    if ! timeout $SERVICE_TIMEOUT sh -c "while ! wget --no-proxy -q -O- $MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT/v1/health; do sleep 1; done"; then
+        die $LINENO "Marconi did not start"
+    fi
 }
 
 # stop_marconi() - Stop running processes
@@ -176,9 +186,9 @@
         openstack endpoint create \
             $MARCONI_SERVICE \
             --region RegionOne \
-            --publicurl "http://$SERVICE_HOST:8888" \
-            --adminurl "http://$SERVICE_HOST:8888" \
-            --internalurl "http://$SERVICE_HOST:8888"
+            --publicurl "$MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT" \
+            --adminurl "$MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT" \
+            --internalurl "$MARCONI_SERVICE_PROTOCOL://$MARCONI_SERVICE_HOST:$MARCONI_SERVICE_PORT"
     fi
 
 }
diff --git a/lib/neutron_plugins/midonet b/lib/neutron_plugins/midonet
index f95fcb7..dd3b2ba 100644
--- a/lib/neutron_plugins/midonet
+++ b/lib/neutron_plugins/midonet
@@ -1,6 +1,10 @@
 # Neutron MidoNet plugin
 # ----------------------
 
+MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
+MIDONET_API_PORT=${MIDONET_API_PORT:-8080}
+MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api}
+
 # Save trace setting
 MY_XTRACE=$(set +o | grep xtrace)
 set +o xtrace
@@ -47,8 +51,8 @@
 }
 
 function neutron_plugin_configure_service() {
-    if [[ "$MIDONET_API_URI" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URI
+    if [[ "$MIDONET_API_URL" != "" ]]; then
+        iniset /$Q_PLUGIN_CONF_FILE MIDONET midonet_uri $MIDONET_API_URL
     fi
     if [[ "$MIDONET_USERNAME" != "" ]]; then
         iniset /$Q_PLUGIN_CONF_FILE MIDONET username $MIDONET_USERNAME
@@ -59,9 +63,6 @@
     if [[ "$MIDONET_PROJECT_ID" != "" ]]; then
         iniset /$Q_PLUGIN_CONF_FILE MIDONET project_id $MIDONET_PROJECT_ID
     fi
-    if [[ "$MIDONET_PROVIDER_ROUTER_ID" != "" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $MIDONET_PROVIDER_ROUTER_ID
-    fi
 
     Q_L3_ENABLED=True
     Q_L3_ROUTER_PER_TENANT=True
diff --git a/lib/neutron_thirdparty/midonet b/lib/neutron_thirdparty/midonet
index e672528..98be425 100644
--- a/lib/neutron_thirdparty/midonet
+++ b/lib/neutron_thirdparty/midonet
@@ -10,20 +10,12 @@
 
 # MidoNet devstack destination dir
 MIDONET_DIR=${MIDONET_DIR:-$DEST/midonet}
-MIDONET_API_PORT=${MIDONET_API_PORT:-8080}
-MIDONET_API_URL=${MIDONET_API_URL:-http://localhost:$MIDONET_API_PORT/midonet-api}
 
 # MidoNet client repo
 MIDONET_CLIENT_REPO=${MIDONET_CLIENT_REPO:-https://github.com/midokura/python-midonetclient.git}
 MIDONET_CLIENT_BRANCH=${MIDONET_CLIENT_BRANCH:-master}
 MIDONET_CLIENT_DIR=${MIDONET_CLIENT_DIR:-$MIDONET_DIR/python-midonetclient}
 
-# MidoNet OpenStack repo
-MIDONET_OS_REPO=${MIDONET_OS_REPO:-https://github.com/midokura/midonet-openstack.git}
-MIDONET_OS_BRANCH=${MIDONET_OS_BRANCH:-master}
-MIDONET_OS_DIR=${MIDONET_OS_DIR:-$MIDONET_DIR/midonet-openstack}
-MIDONET_SETUP_SCRIPT=${MIDONET_SETUP_SCRIPT:-$MIDONET_OS_DIR/bin/setup_midonet_topology.py}
-
 # Save trace setting
 MY_XTRACE=$(set +o | grep xtrace)
 set +o xtrace
@@ -33,19 +25,12 @@
 }
 
 function init_midonet() {
-
-    # Initialize DB.  Evaluate the output of setup_midonet_topology.py to set
-    # env variables for provider router ID.
-    eval `python $MIDONET_SETUP_SCRIPT $MIDONET_API_URL admin $ADMIN_PASSWORD admin provider_devices`
-    die_if_not_set $LINENO provider_router_id "Error running midonet setup script, provider_router_id was not set."
-
-    iniset /$Q_PLUGIN_CONF_FILE MIDONET provider_router_id $provider_router_id
+    :
 }
 
 function install_midonet() {
     git_clone $MIDONET_CLIENT_REPO $MIDONET_CLIENT_DIR $MIDONET_CLIENT_BRANCH
-    git_clone $MIDONET_OS_REPO $MIDONET_OS_DIR $MIDONET_OS_BRANCH
-    export PYTHONPATH=$MIDONET_CLIENT_DIR/src:$MIDONET_OS_DIR/src:$PYTHONPATH
+    export PYTHONPATH=$MIDONET_CLIENT_DIR/src:$PYTHONPATH
 }
 
 function start_midonet() {
diff --git a/lib/stackforge b/lib/stackforge
index 718b818..5fa4570 100644
--- a/lib/stackforge
+++ b/lib/stackforge
@@ -6,8 +6,9 @@
 # This is appropriate for python libraries that release to pypi and are
 # expected to be used beyond OpenStack like, but are requirements
 # for core services in global-requirements.
-#    * wsme
-#    * pecan
+#
+#     * wsme
+#     * pecan
 #
 # This is not appropriate for stackforge projects which are early stage
 # OpenStack tools
diff --git a/lib/tempest b/lib/tempest
index c8eebfc..596750b 100644
--- a/lib/tempest
+++ b/lib/tempest
@@ -314,8 +314,8 @@
     iniset $TEMPEST_CONFIG scenario large_ops_number ${TEMPEST_LARGE_OPS_NUMBER:-0}
 
     # Volume
-    if is_service_enabled c-bak; then
-        iniset $TEMPEST_CONFIG volume volume_backup_enabled "True"
+    if ! is_service_enabled c-bak; then
+        iniset $TEMPEST_CONFIG volume-feature-enabled backup False
     fi
     CINDER_MULTI_LVM_BACKEND=$(trueorfalse False $CINDER_MULTI_LVM_BACKEND)
     if [ $CINDER_MULTI_LVM_BACKEND == "True" ]; then
diff --git a/run_tests.sh b/run_tests.sh
index 9d9d186..b4f26c5 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -20,7 +20,7 @@
 else
     LIBS=`find lib -type f | grep -v \.md`
     SCRIPTS=`find . -type f -name \*\.sh`
-    EXTRA="functions"
+    EXTRA="functions functions-common stackrc openrc exerciserc eucarc"
     FILES="$SCRIPTS $LIBS $EXTRA"
 fi
 
diff --git a/tools/create_userrc.sh b/tools/create_userrc.sh
index a2d0c52..cd5a1c9 100755
--- a/tools/create_userrc.sh
+++ b/tools/create_userrc.sh
@@ -54,9 +54,7 @@
 EOF
 }
 
-if ! options=$(getopt -o hPAp:u:r:C: -l os-username:,os-password:,os-tenant-name:,os-tenant-id:,os-auth-url:,target-dir:,skip-tenant:,os-cacert:,help,debug -- "$@")
-then
-    #parse error
+if ! options=$(getopt -o hPAp:u:r:C: -l os-username:,os-password:,os-tenant-name:,os-tenant-id:,os-auth-url:,target-dir:,skip-tenant:,os-cacert:,help,debug -- "$@"); then
     display_help
     exit 1
 fi
diff --git a/tools/fixup_stuff.sh b/tools/fixup_stuff.sh
index a28e10e..47b0cd1 100755
--- a/tools/fixup_stuff.sh
+++ b/tools/fixup_stuff.sh
@@ -70,7 +70,8 @@
 fi
 
 # Ubuntu 12.04
-# -----
+# ------------
+
 # We can regularly get kernel crashes on the 12.04 default kernel, so attempt
 # to install a new kernel
 if [[ ${DISTRO} =~ (precise) ]]; then
diff --git a/tools/info.sh b/tools/info.sh
index 3ab7966..1e521b9 100755
--- a/tools/info.sh
+++ b/tools/info.sh
@@ -122,13 +122,11 @@
             ver=${BASH_REMATCH[2]}
         else
             # Unhandled format in freeze file
-            #echo "unknown: $p"
             continue
         fi
         echo "pip|${p}|${ver}"
     else
         # No match in freeze file
-        #echo "unknown: $p"
         continue
     fi
 done <$FREEZE_FILE
diff --git a/tools/xen/build_domU_multi.sh b/tools/xen/build_domU_multi.sh
index 0285f42..0eb2077 100755
--- a/tools/xen/build_domU_multi.sh
+++ b/tools/xen/build_domU_multi.sh
@@ -25,11 +25,5 @@
 # because rabbit won't launch with an ip addr hostname :(
 build_xva HEADNODE $HEAD_PUB_IP $HEAD_MGT_IP 1 "ENABLED_SERVICES=g-api,g-reg,key,n-api,n-sch,n-vnc,horizon,mysql,rabbit"
 
-# Wait till the head node is up
-#while ! curl -L http://$HEAD_PUB_IP | grep -q username; do
-#    echo "Waiting for head node ($HEAD_PUB_IP) to start..."
-#    sleep 5
-#done
-
 # Build the HA compute host
 build_xva COMPUTENODE $COMPUTE_PUB_IP $COMPUTE_MGT_IP 0 "ENABLED_SERVICES=n-cpu,n-net,n-api"