Merge "Add the role heat_stack_user for heat"
diff --git a/files/keystone_data.sh b/files/keystone_data.sh
index a4f08e4..17e8c59 100755
--- a/files/keystone_data.sh
+++ b/files/keystone_data.sh
@@ -5,7 +5,6 @@
 # Tenant               User       Roles
 # ------------------------------------------------------------------
 # service              glance     admin
-# service              nova       admin, [ResellerAdmin (swift only)]
 # service              quantum    admin        # if enabled
 # service              swift      admin        # if enabled
 # service              cinder     admin        # if enabled
@@ -53,29 +52,8 @@
 # Services
 # --------
 
-# Nova
-if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
-    NOVA_USER=$(get_id keystone user-create \
-        --name=nova \
-        --pass="$SERVICE_PASSWORD" \
-        --tenant_id $SERVICE_TENANT \
-        --email=nova@example.com)
-    keystone user-role-add \
-        --tenant_id $SERVICE_TENANT \
-        --user_id $NOVA_USER \
-        --role_id $ADMIN_ROLE
-    if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
-        NOVA_SERVICE=$(get_id keystone service-create \
-            --name=nova \
-            --type=compute \
-            --description="Nova Compute Service")
-        keystone endpoint-create \
-            --region RegionOne \
-            --service_id $NOVA_SERVICE \
-            --publicurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s" \
-            --adminurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s" \
-            --internalurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s"
-    fi
+if [[ "$ENABLED_SERVICES" =~ "n-api" ]] && [[ "$ENABLED_SERVICES" =~ "swift" ]]; then
+    NOVA_USER=$(keystone user-list | awk "/ nova / { print \$2 }")
     # Nova needs ResellerAdmin role to download images when accessing
     # swift through the s3 api.
     keystone user-role-add \
diff --git a/functions b/functions
index 0911557..3ee43d3 100644
--- a/functions
+++ b/functions
@@ -354,6 +354,18 @@
 }
 
 
+# Determine if current distribution is a Fedora-based distribution
+# (Fedora, RHEL, CentOS).
+# is_fedora
+function is_fedora {
+    if [[ -z "$os_VENDOR" ]]; then
+        GetOSVersion
+    fi
+
+    [ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || [ "$os_VENDOR" = "CentOS" ]
+}
+
+
 # Determine if current distribution is a SUSE-based distribution
 # (openSUSE, SLE).
 # is_suse
@@ -366,6 +378,23 @@
 }
 
 
+# Exit after outputting a message about the distribution not being supported.
+# exit_distro_not_supported [optional-string-telling-what-is-missing]
+function exit_distro_not_supported {
+    if [[ -z "$DISTRO" ]]; then
+        GetDistro
+    fi
+
+    if [ $# -gt 0 ]; then
+        echo "Support for $DISTRO is incomplete: no support for $@"
+    else
+        echo "Support for $DISTRO is incomplete."
+    fi
+
+    exit 1
+}
+
+
 # git clone only if directory doesn't exist already.  Since ``DEST`` might not
 # be owned by the installation user, we create the directory and change the
 # ownership to the proper user.
@@ -598,12 +627,12 @@
         NO_UPDATE_REPOS=True
 
         apt_get install "$@"
+    elif is_fedora; then
+        yum_install "$@"
+    elif is_suse; then
+        zypper_install "$@"
     else
-        if is_suse; then
-            zypper_install "$@"
-        else
-            yum_install "$@"
-        fi
+        exit_distro_not_supported "installing packages"
     fi
 }
 
@@ -622,9 +651,11 @@
     if [[ "$os_PACKAGE" = "deb" ]]; then
         dpkg -l "$@" > /dev/null
         return $?
-    else
+    elif [[ "$os_PACKAGE" = "rpm" ]]; then
         rpm --quiet -q "$@"
         return $?
+    else
+        exit_distro_not_supported "finding if a package is installed"
     fi
 }
 
@@ -1032,20 +1063,20 @@
 function get_rootwrap_location() {
     local module=$1
 
-    if is_ubuntu || is_suse; then
-        echo "/usr/local/bin/$module-rootwrap"
-    else
+    if is_fedora; then
         echo "/usr/bin/$module-rootwrap"
+    else
+        echo "/usr/local/bin/$module-rootwrap"
     fi
 }
 
 # Get the path to the pip command.
 # get_pip_command
 function get_pip_command() {
-    if is_ubuntu || is_suse; then
-        echo "/usr/bin/pip"
-    else
+    if is_fedora; then
         echo "/usr/bin/pip-python"
+    else
+        echo "/usr/bin/pip"
     fi
 }
 
diff --git a/lib/cinder b/lib/cinder
index 9b9d50d..a43f0a1 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -195,8 +195,8 @@
         mkdir -p $CINDER_STATE_PATH/volumes
 
         if sudo vgs $VOLUME_GROUP; then
-            if [[ "$os_PACKAGE" = "rpm" ]]; then
-                # RPM doesn't start the service
+            if is_fedora || is_suse; then
+                # service is not started by default
                 start_service tgtd
             fi
 
@@ -245,9 +245,15 @@
             # do it in two steps
             sudo stop tgt || true
             sudo start tgt
-        else
+        elif is_fedora; then
             # bypass redirection to systemctl during restart
             sudo /sbin/service --skip-redirect tgtd restart
+        elif is_suse; then
+            restart_service tgtd
+        else
+            # note for other distros: unstack.sh also uses the tgt/tgtd service
+            # name, and would need to be adjusted too
+            exit_distro_not_supported "restarting tgt"
         fi
     fi
 
diff --git a/lib/databases/mysql b/lib/databases/mysql
index 60ea143..68e9adc 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -23,22 +23,28 @@
     if is_ubuntu; then
         MY_CONF=/etc/mysql/my.cnf
         MYSQL=mysql
-    else
+    elif is_fedora; then
         MY_CONF=/etc/my.cnf
-        if is_suse; then
-            MYSQL=mysql
-        else
-            MYSQL=mysqld
-        fi
+        MYSQL=mysqld
+    elif is_suse; then
+        MY_CONF=/etc/my.cnf
+        MYSQL=mysql
+    else
+        exit_distro_not_supported "mysql configuration"
     fi
 
     # Start mysql-server
-    if [[ "$os_PACKAGE" = "rpm" ]]; then
-        # RPM doesn't start the service
+    if is_fedora || is_suse; then
+        # service is not started by default
         start_service $MYSQL
-        # Set the root password - only works the first time
+    fi
+
+    # Set the root password - only works the first time. For Ubuntu, we already
+    # did that with debconf before installing the package.
+    if ! is_ubuntu; then
         sudo mysqladmin -u root password $DATABASE_PASSWORD || true
     fi
+
     # Update the DB to give user ‘$DATABASE_USER’@’%’ full control of the all databases:
     sudo mysql -uroot -p$DATABASE_PASSWORD -h127.0.0.1 -e "GRANT ALL PRIVILEGES ON *.* TO '$DATABASE_USER'@'%' identified by '$DATABASE_PASSWORD';"
 
@@ -84,10 +90,12 @@
         chmod 0600 $HOME/.my.cnf
     fi
     # Install mysql-server
-    if is_suse; then
+    if is_ubuntu || is_fedora; then
+        install_package mysql-server
+    elif is_suse; then
         install_package mysql-community-server
     else
-        install_package mysql-server
+        exit_distro_not_supported "mysql installation"
     fi
 }
 
diff --git a/lib/databases/postgresql b/lib/databases/postgresql
index d9c2f00..20ade85 100644
--- a/lib/databases/postgresql
+++ b/lib/databases/postgresql
@@ -20,7 +20,7 @@
 
 function configure_database_postgresql {
     echo_summary "Configuring and starting PostgreSQL"
-    if [[ "$os_PACKAGE" = "rpm" ]]; then
+    if is_fedora || is_suse; then
         PG_HBA=/var/lib/pgsql/data/pg_hba.conf
         PG_CONF=/var/lib/pgsql/data/postgresql.conf
         sudo [ -e $PG_HBA ] || sudo postgresql-setup initdb
@@ -53,10 +53,12 @@
     else
         sed -i "s/:root:\w\+/:root:$DATABASE_PASSWORD/" $PGPASS
     fi
-    if [[ "$os_PACKAGE" = "rpm" ]]; then
+    if is_ubuntu; then
+        install_package postgresql
+    elif is_fedora || is_suse; then
         install_package postgresql-server
     else
-        install_package postgresql
+        exit_distro_not_supported "postgresql installation"
     fi
 }
 
diff --git a/lib/heat b/lib/heat
index b640fbc..feaadec 100644
--- a/lib/heat
+++ b/lib/heat
@@ -124,7 +124,7 @@
     iniset $HEAT_ENGINE_CONF DEFAULT bind_host $HEAT_ENGINE_HOST
     iniset $HEAT_ENGINE_CONF DEFAULT bind_port $HEAT_ENGINE_PORT
     iniset $HEAT_ENGINE_CONF DEFAULT heat_metadata_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT
-    iniset $HEAT_ENGINE_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_CFN_HOST:$HEAT_CFN_PORT/v1/waitcondition
+    iniset $HEAT_ENGINE_CONF DEFAULT heat_waitcondition_server_url http://$HEAT_API_CFN_HOST:$HEAT_API_CFN_PORT/v1/waitcondition
     iniset $HEAT_ENGINE_CONF DEFAULT heat_watch_server_url http://$HEAT_API_CW_HOST:$HEAT_API_CW_PORT
     local dburl
     database_connection_url dburl heat
diff --git a/lib/horizon b/lib/horizon
index 7321cbc..68337ab 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -81,19 +81,18 @@
         sudo a2ensite horizon
         # WSGI doesn't enable by default, enable it
         sudo a2enmod wsgi
+    elif is_fedora; then
+        APACHE_NAME=httpd
+        APACHE_CONF=conf.d/horizon.conf
+        sudo sed '/^Listen/s/^.*$/Listen 0.0.0.0:80/' -i /etc/httpd/conf/httpd.conf
+    elif is_suse; then
+        APACHE_NAME=apache2
+        APACHE_CONF=vhosts.d/horizon.conf
+        # Append wsgi to the list of modules to load
+        grep -q "^APACHE_MODULES=.*wsgi" /etc/sysconfig/apache2 ||
+            sudo sed '/^APACHE_MODULES=/s/^\(.*\)"$/\1 wsgi"/' -i /etc/sysconfig/apache2
     else
-        # Install httpd, which is NOPRIME'd
-        if is_suse; then
-            APACHE_NAME=apache2
-            APACHE_CONF=vhosts.d/horizon.conf
-            # Append wsgi to the list of modules to load
-            grep -q "^APACHE_MODULES=.*wsgi" /etc/sysconfig/apache2 ||
-                sudo sed '/^APACHE_MODULES=/s/^\(.*\)"$/\1 wsgi"/' -i /etc/sysconfig/apache2
-        else
-            APACHE_NAME=httpd
-            APACHE_CONF=conf.d/horizon.conf
-            sudo sed '/^Listen/s/^.*$/Listen 0.0.0.0:80/' -i /etc/httpd/conf/httpd.conf
-        fi
+        exit_distro_not_supported "apache configuration"
     fi
 
     # Configure apache to run horizon
@@ -113,11 +112,13 @@
     if is_ubuntu; then
         # Install apache2, which is NOPRIME'd
         install_package apache2 libapache2-mod-wsgi
+    elif is_fedora; then
+        sudo rm -f /etc/httpd/conf.d/000-*
+        install_package httpd mod_wsgi
     elif is_suse; then
         install_package apache2 apache2-mod_wsgi
     else
-        sudo rm -f /etc/httpd/conf.d/000-*
-        install_package httpd mod_wsgi
+        exit_distro_not_supported "apache installation"
     fi
 
     # NOTE(sdague) quantal changed the name of the node binary
diff --git a/lib/nova b/lib/nova
index 3a4d34d..86db561 100644
--- a/lib/nova
+++ b/lib/nova
@@ -277,6 +277,46 @@
     fi
 }
 
+# create_nova_accounts() - Set up common required nova accounts
+
+# Tenant               User       Roles
+# ------------------------------------------------------------------
+# service              nova       admin, [ResellerAdmin (swift only)]
+
+# Migrated from keystone_data.sh
+create_nova_accounts() {
+
+    SERVICE_TENANT=$(keystone tenant-list | awk "/ $SERVICE_TENANT_NAME / { print \$2 }")
+    ADMIN_ROLE=$(keystone role-list | awk "/ admin / { print \$2 }")
+
+    # Nova
+    if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
+        NOVA_USER=$(keystone user-create \
+            --name=nova \
+            --pass="$SERVICE_PASSWORD" \
+            --tenant_id $SERVICE_TENANT \
+            --email=nova@example.com \
+            | grep " id " | get_field 2)
+        keystone user-role-add \
+            --tenant_id $SERVICE_TENANT \
+            --user_id $NOVA_USER \
+            --role_id $ADMIN_ROLE
+        if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
+            NOVA_SERVICE=$(keystone service-create \
+                --name=nova \
+                --type=compute \
+                --description="Nova Compute Service" \
+                | grep " id " | get_field 2)
+            keystone endpoint-create \
+                --region RegionOne \
+                --service_id $NOVA_SERVICE \
+                --publicurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s" \
+                --adminurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s" \
+                --internalurl "http://$SERVICE_HOST:\$(compute_port)s/v2/\$(tenant_id)s"
+        fi
+    fi
+}
+
 # create_nova_conf() - Create a new nova.conf file
 function create_nova_conf() {
     # Remove legacy ``nova.conf``
@@ -394,11 +434,13 @@
 function install_nova() {
     if is_service_enabled n-cpu; then
         if is_ubuntu; then
-            LIBVIRT_PKG_NAME=libvirt-bin
+            install_package libvirt-bin
+        elif is_fedora || is_suse; then
+            install_package libvirt
         else
-            LIBVIRT_PKG_NAME=libvirt
+            exit_distro_not_supported "libvirt installation"
         fi
-        install_package $LIBVIRT_PKG_NAME
+
         # Install and configure **LXC** if specified.  LXC is another approach to
         # splitting a system into many smaller parts.  LXC uses cgroups and chroot
         # to simulate multiple systems.
diff --git a/lib/quantum b/lib/quantum
index cb68339..4e9f298 100644
--- a/lib/quantum
+++ b/lib/quantum
@@ -1,17 +1,69 @@
 # lib/quantum
 # functions - funstions specific to quantum
 
+# Dependencies:
+# ``functions`` file
+# ``DEST`` must be defined
+
+
+# Quantum Networking
+# ------------------
+
+# Make sure that quantum is enabled in ``ENABLED_SERVICES``.  If you want
+# to run Quantum on this host, make sure that q-svc is also in
+# ``ENABLED_SERVICES``.
+#
+# If you're planning to use the Quantum openvswitch plugin, set
+# ``Q_PLUGIN`` to "openvswitch" and make sure the q-agt service is enabled
+# in ``ENABLED_SERVICES``.  If you're planning to use the Quantum
+# linuxbridge plugin, set ``Q_PLUGIN`` to "linuxbridge" and make sure the
+# q-agt service is enabled in ``ENABLED_SERVICES``.
+#
+# See "Quantum Network Configuration" below for additional variables
+# that must be set in localrc for connectivity across hosts with
+# Quantum.
+#
+# With Quantum networking the NET_MAN variable is ignored.
+
+
 # Save trace setting
 XTRACE=$(set +o | grep xtrace)
 set +o xtrace
 
+
+# Defaults
+# --------
+
+# Set up default directories
 QUANTUM_DIR=$DEST/quantum
-export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"}
+QUANTUMCLIENT_DIR=$DEST/python-quantumclient
 QUANTUM_AUTH_CACHE_DIR=${QUANTUM_AUTH_CACHE_DIR:-/var/cache/quantum}
 
+QUANTUM_CONF_DIR=/etc/quantum
+QUANTUM_CONF=$QUANTUM_CONF_DIR/quantum.conf
+export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"$QUANTUM_CONF_DIR/debug.ini"}
+
+# Default Quantum Plugin
+Q_PLUGIN=${Q_PLUGIN:-openvswitch}
+# Default Quantum Port
+Q_PORT=${Q_PORT:-9696}
+# Default Quantum Host
+Q_HOST=${Q_HOST:-$HOST_IP}
+# Which Quantum API nova should use
+# Default admin username
+Q_ADMIN_USERNAME=${Q_ADMIN_USERNAME:-quantum}
+# Default auth strategy
+Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone}
+# Use namespace or not
+Q_USE_NAMESPACE=${Q_USE_NAMESPACE:-True}
+Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP:-True}
+# Meta data IP
+Q_META_DATA_IP=${Q_META_DATA_IP:-$HOST_IP}
+# Use quantum-debug command
+Q_USE_DEBUG_COMMAND=${Q_USE_DEBUG_COMMAND:-False}
+
 if is_service_enabled quantum; then
-    Q_CONF_FILE=/etc/quantum/quantum.conf
-    Q_RR_CONF_FILE=/etc/quantum/rootwrap.conf
+    Q_RR_CONF_FILE=$QUANTUM_CONF_DIR/rootwrap.conf
     if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
         Q_RR_COMMAND="sudo"
     else
@@ -20,6 +72,10 @@
     fi
 fi
 
+
+# Entry Points
+# ------------
+
 # configure_quantum_rootwrap() - configure Quantum's rootwrap
 function configure_quantum_rootwrap() {
     if [[ "$Q_USE_ROOTWRAP" == "False" ]]; then
@@ -27,16 +83,16 @@
     fi
     # Deploy new rootwrap filters files (owned by root).
     # Wipe any existing rootwrap.d files first
-    Q_CONF_ROOTWRAP_D=/etc/quantum/rootwrap.d
+    Q_CONF_ROOTWRAP_D=$QUANTUM_CONF_DIR/rootwrap.d
     if [[ -d $Q_CONF_ROOTWRAP_D ]]; then
         sudo rm -rf $Q_CONF_ROOTWRAP_D
     fi
-    # Deploy filters to /etc/quantum/rootwrap.d
+    # Deploy filters to $QUANTUM_CONF_DIR/rootwrap.d
     mkdir -p -m 755 $Q_CONF_ROOTWRAP_D
     cp -pr $QUANTUM_DIR/etc/quantum/rootwrap.d/* $Q_CONF_ROOTWRAP_D/
     sudo chown -R root:root $Q_CONF_ROOTWRAP_D
     sudo chmod 644 $Q_CONF_ROOTWRAP_D/*
-    # Set up rootwrap.conf, pointing to /etc/quantum/rootwrap.d
+    # Set up rootwrap.conf, pointing to $QUANTUM_CONF_DIR/rootwrap.d
     sudo cp -p $QUANTUM_DIR/etc/rootwrap.conf $Q_RR_CONF_FILE
     sudo sed -e "s:^filters_path=.*$:filters_path=$Q_CONF_ROOTWRAP_D:" -i $Q_RR_CONF_FILE
     sudo chown root:root $Q_RR_CONF_FILE
@@ -52,7 +108,6 @@
     sudo mv $TEMPFILE /etc/sudoers.d/quantum-rootwrap
 }
 
-
 # Configures keystone integration for quantum service and agents
 function quantum_setup_keystone() {
     local conf_file=$1
diff --git a/stack.sh b/stack.sh
index 05f5f35..da0faed 100755
--- a/stack.sh
+++ b/stack.sh
@@ -321,26 +321,6 @@
 OPENSTACKCLIENT_DIR=$DEST/python-openstackclient
 NOVNC_DIR=$DEST/noVNC
 SWIFT3_DIR=$DEST/swift3
-QUANTUM_CLIENT_DIR=$DEST/python-quantumclient
-
-# Default Quantum Plugin
-Q_PLUGIN=${Q_PLUGIN:-openvswitch}
-# Default Quantum Port
-Q_PORT=${Q_PORT:-9696}
-# Default Quantum Host
-Q_HOST=${Q_HOST:-$HOST_IP}
-# Which Quantum API nova should use
-# Default admin username
-Q_ADMIN_USERNAME=${Q_ADMIN_USERNAME:-quantum}
-# Default auth strategy
-Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone}
-# Use namespace or not
-Q_USE_NAMESPACE=${Q_USE_NAMESPACE:-True}
-Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP:-True}
-# Meta data IP
-Q_META_DATA_IP=${Q_META_DATA_IP:-$HOST_IP}
-# Use quantum-debug command
-Q_USE_DEBUG_COMMAND=${Q_USE_DEBUG_COMMAND:-False}
 
 RYU_DIR=$DEST/ryu
 # Ryu API Host
@@ -458,26 +438,6 @@
 ## FIXME(ja): should/can we check that FLAT_INTERFACE is sane?
 
 
-# Quantum Networking
-# ------------------
-
-# Make sure that quantum is enabled in ENABLED_SERVICES.  If you want
-# to run Quantum on this host, make sure that q-svc is also in
-# ENABLED_SERVICES.
-#
-# If you're planning to use the Quantum openvswitch plugin, set
-# Q_PLUGIN to "openvswitch" and make sure the q-agt service is enabled
-# in ENABLED_SERVICES.  If you're planning to use the Quantum
-# linuxbridge plugin, set Q_PLUGIN to "linuxbridge" and make sure the
-# q-agt service is enabled in ENABLED_SERVICES.
-#
-# See "Quantum Network Configuration" below for additional variables
-# that must be set in localrc for connectivity across hosts with
-# Quantum.
-#
-# With Quantum networking the NET_MAN variable is ignored.
-
-
 # Database Configuration
 # ----------------------
 
@@ -686,17 +646,21 @@
 echo_summary "Installing package prerequisites"
 if is_ubuntu; then
     install_package $(get_packages $FILES/apts)
+elif is_fedora; then
+    install_package $(get_packages $FILES/rpms)
 elif is_suse; then
     install_package $(get_packages $FILES/rpms-suse)
 else
-    install_package $(get_packages $FILES/rpms)
+    exit_distro_not_supported "list of packages"
 fi
 
 if [[ $SYSLOG != "False" ]]; then
-    if is_suse; then
+    if is_ubuntu || is_fedora; then
+        install_package rsyslog-relp
+    elif is_suse; then
         install_package rsyslog-module-relp
     else
-        install_package rsyslog-relp
+        exit_distro_not_supported "rsyslog-relp installation"
     fi
 fi
 
@@ -708,20 +672,22 @@
     cat "$tfile"
     rm -f "$tfile"
 elif is_service_enabled qpid; then
-    if [[ "$os_PACKAGE" = "rpm" ]]; then
+    if is_fedora; then
         install_package qpid-cpp-server-daemon
-    else
+    elif is_ubuntu; then
         install_package qpidd
+    else
+        exit_distro_not_supported "qpid installation"
     fi
 elif is_service_enabled zeromq; then
-    if [[ "$os_PACKAGE" = "rpm" ]]; then
-        if is_suse; then
-            install_package libzmq1 python-pyzmq
-        else
-            install_package zeromq python-zmq
-        fi
-    else
+    if is_fedora; then
+        install_package zeromq python-zmq
+    elif is_ubuntu; then
         install_package libzmq1 python-zmq
+    elif is_suse; then
+        install_package libzmq1 python-pyzmq
+    else
+        exit_distro_not_supported "zeromq installation"
     fi
 fi
 
@@ -805,7 +771,7 @@
     install_horizon
 fi
 if is_service_enabled quantum; then
-    git_clone $QUANTUM_CLIENT_REPO $QUANTUM_CLIENT_DIR $QUANTUM_CLIENT_BRANCH
+    git_clone $QUANTUMCLIENT_REPO $QUANTUMCLIENT_DIR $QUANTUMCLIENT_BRANCH
 fi
 if is_service_enabled quantum; then
     # quantum
@@ -864,7 +830,7 @@
     configure_horizon
 fi
 if is_service_enabled quantum; then
-    setup_develop $QUANTUM_CLIENT_DIR
+    setup_develop $QUANTUMCLIENT_DIR
     setup_develop $QUANTUM_DIR
 fi
 if is_service_enabled heat; then
@@ -917,8 +883,8 @@
 if is_service_enabled rabbit; then
     # Start rabbitmq-server
     echo_summary "Starting RabbitMQ"
-    if [[ "$os_PACKAGE" = "rpm" ]]; then
-        # RPM doesn't start the service
+    if is_fedora || is_suse; then
+        # service is not started by default
         restart_service rabbitmq-server
     fi
     # change the rabbit password since the default is "guest"
@@ -974,6 +940,7 @@
     export OS_SERVICE_TOKEN=$SERVICE_TOKEN
     export OS_SERVICE_ENDPOINT=$SERVICE_ENDPOINT
     create_keystone_accounts
+    create_nova_accounts
 
     # ``keystone_data.sh`` creates services, admin and demo users, and roles.
     ADMIN_PASSWORD=$ADMIN_PASSWORD SERVICE_TENANT_NAME=$SERVICE_TENANT_NAME SERVICE_PASSWORD=$SERVICE_PASSWORD \
@@ -1119,11 +1086,11 @@
     # Example: ``OVS_ENABLE_TUNNELING=True``
     OVS_ENABLE_TUNNELING=${OVS_ENABLE_TUNNELING:-$ENABLE_TENANT_TUNNELS}
 
-    # Put config files in ``/etc/quantum`` for everyone to find
-    if [[ ! -d /etc/quantum ]]; then
-        sudo mkdir -p /etc/quantum
+    # Put config files in ``QUANTUM_CONF_DIR`` for everyone to find
+    if [[ ! -d $QUANTUM_CONF_DIR ]]; then
+        sudo mkdir -p $QUANTUM_CONF_DIR
     fi
-    sudo chown `whoami` /etc/quantum
+    sudo chown `whoami` $QUANTUM_CONF_DIR
 
     if [[ "$Q_PLUGIN" = "openvswitch" ]]; then
         Q_PLUGIN_CONF_PATH=etc/quantum/plugins/openvswitch
@@ -1147,7 +1114,7 @@
         exit 1
     fi
 
-    # If needed, move config file from ``$QUANTUM_DIR/etc/quantum`` to ``/etc/quantum``
+    # If needed, move config file from ``$QUANTUM_DIR/etc/quantum`` to ``QUANTUM_CONF_DIR``
     mkdir -p /$Q_PLUGIN_CONF_PATH
     Q_PLUGIN_CONF_FILE=$Q_PLUGIN_CONF_PATH/$Q_PLUGIN_CONF_FILENAME
     cp $QUANTUM_DIR/$Q_PLUGIN_CONF_FILE /$Q_PLUGIN_CONF_FILE
@@ -1156,14 +1123,14 @@
     iniset /$Q_PLUGIN_CONF_FILE DATABASE sql_connection $dburl
     unset dburl
 
-    cp $QUANTUM_DIR/etc/quantum.conf $Q_CONF_FILE
+    cp $QUANTUM_DIR/etc/quantum.conf $QUANTUM_CONF
     configure_quantum_rootwrap
 fi
 
 # Quantum service (for controller node)
 if is_service_enabled q-svc; then
-    Q_API_PASTE_FILE=/etc/quantum/api-paste.ini
-    Q_POLICY_FILE=/etc/quantum/policy.json
+    Q_API_PASTE_FILE=$QUANTUM_CONF_DIR/api-paste.ini
+    Q_POLICY_FILE=$QUANTUM_CONF_DIR/policy.json
 
     cp $QUANTUM_DIR/etc/api-paste.ini $Q_API_PASTE_FILE
     cp $QUANTUM_DIR/etc/policy.json $Q_POLICY_FILE
@@ -1176,9 +1143,9 @@
     fi
 
     # Update either configuration file with plugin
-    iniset $Q_CONF_FILE DEFAULT core_plugin $Q_PLUGIN_CLASS
+    iniset $QUANTUM_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS
 
-    iniset $Q_CONF_FILE DEFAULT auth_strategy $Q_AUTH_STRATEGY
+    iniset $QUANTUM_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY
     quantum_setup_keystone $Q_API_PASTE_FILE filter:authtoken
 
     # Configure plugin
@@ -1295,7 +1262,7 @@
 if is_service_enabled q-dhcp; then
     AGENT_DHCP_BINARY="$QUANTUM_DIR/bin/quantum-dhcp-agent"
 
-    Q_DHCP_CONF_FILE=/etc/quantum/dhcp_agent.ini
+    Q_DHCP_CONF_FILE=$QUANTUM_CONF_DIR/dhcp_agent.ini
 
     cp $QUANTUM_DIR/etc/dhcp_agent.ini $Q_DHCP_CONF_FILE
 
@@ -1325,7 +1292,7 @@
 if is_service_enabled q-l3; then
     AGENT_L3_BINARY="$QUANTUM_DIR/bin/quantum-l3-agent"
     PUBLIC_BRIDGE=${PUBLIC_BRIDGE:-br-ex}
-    Q_L3_CONF_FILE=/etc/quantum/l3_agent.ini
+    Q_L3_CONF_FILE=$QUANTUM_CONF_DIR/l3_agent.ini
 
     cp $QUANTUM_DIR/etc/l3_agent.ini $Q_L3_CONF_FILE
 
@@ -1361,7 +1328,7 @@
 #Quantum Metadata
 if is_service_enabled q-meta; then
     AGENT_META_BINARY="$QUANTUM_DIR/bin/quantum-metadata-agent"
-    Q_META_CONF_FILE=/etc/quantum/metadata_agent.ini
+    Q_META_CONF_FILE=$QUANTUM_CONF_DIR/metadata_agent.ini
 
     cp $QUANTUM_DIR/etc/metadata_agent.ini $Q_META_CONF_FILE
 
@@ -1381,14 +1348,14 @@
 
 # Quantum RPC support - must be updated prior to starting any of the services
 if is_service_enabled quantum; then
-    iniset $Q_CONF_FILE DEFAULT control_exchange quantum
+    iniset $QUANTUM_CONF DEFAULT control_exchange quantum
     if is_service_enabled qpid ; then
-        iniset $Q_CONF_FILE DEFAULT rpc_backend quantum.openstack.common.rpc.impl_qpid
+        iniset $QUANTUM_CONF DEFAULT rpc_backend quantum.openstack.common.rpc.impl_qpid
     elif is_service_enabled zeromq; then
-        iniset $Q_CONF_FILE DEFAULT rpc_backend quantum.openstack.common.rpc.impl_zmq
+        iniset $QUANTUM_CONF DEFAULT rpc_backend quantum.openstack.common.rpc.impl_zmq
     elif [ -n "$RABBIT_HOST" ] &&  [ -n "$RABBIT_PASSWORD" ]; then
-        iniset $Q_CONF_FILE DEFAULT rabbit_host $RABBIT_HOST
-        iniset $Q_CONF_FILE DEFAULT rabbit_password $RABBIT_PASSWORD
+        iniset $QUANTUM_CONF DEFAULT rabbit_host $RABBIT_HOST
+        iniset $QUANTUM_CONF DEFAULT rabbit_password $RABBIT_PASSWORD
     fi
     if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
         cp $QUANTUM_DIR/etc/l3_agent.ini $QUANTUM_TEST_CONFIG_FILE
@@ -1597,7 +1564,7 @@
 if is_service_enabled q-svc; then
     echo_summary "Starting Quantum"
     # Start the Quantum service
-    screen_it q-svc "cd $QUANTUM_DIR && python $QUANTUM_DIR/bin/quantum-server --config-file $Q_CONF_FILE --config-file /$Q_PLUGIN_CONF_FILE"
+    screen_it q-svc "cd $QUANTUM_DIR && python $QUANTUM_DIR/bin/quantum-server --config-file $QUANTUM_CONF --config-file /$Q_PLUGIN_CONF_FILE"
     echo "Waiting for Quantum to start..."
     if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- http://127.0.0.1:9696; do sleep 1; done"; then
       echo "Quantum did not start"
@@ -1649,10 +1616,10 @@
 fi
 
 # Start up the quantum agents if enabled
-screen_it q-agt "python $AGENT_BINARY --config-file $Q_CONF_FILE --config-file /$Q_PLUGIN_CONF_FILE"
-screen_it q-dhcp "python $AGENT_DHCP_BINARY --config-file $Q_CONF_FILE --config-file=$Q_DHCP_CONF_FILE"
-screen_it q-meta "python $AGENT_META_BINARY --config-file $Q_CONF_FILE --config-file=$Q_META_CONF_FILE"
-screen_it q-l3 "python $AGENT_L3_BINARY --config-file $Q_CONF_FILE --config-file=$Q_L3_CONF_FILE"
+screen_it q-agt "python $AGENT_BINARY --config-file $QUANTUM_CONF --config-file /$Q_PLUGIN_CONF_FILE"
+screen_it q-dhcp "python $AGENT_DHCP_BINARY --config-file $QUANTUM_CONF --config-file=$Q_DHCP_CONF_FILE"
+screen_it q-meta "python $AGENT_META_BINARY --config-file $QUANTUM_CONF --config-file=$Q_META_CONF_FILE"
+screen_it q-l3 "python $AGENT_L3_BINARY --config-file $QUANTUM_CONF --config-file=$Q_L3_CONF_FILE"
 
 if is_service_enabled nova; then
     echo_summary "Starting Nova"
diff --git a/stackrc b/stackrc
index 39d34b0..8b42c24 100644
--- a/stackrc
+++ b/stackrc
@@ -14,7 +14,7 @@
 # ``disable_service`` functions in ``localrc``.
 # For example, to enable Swift add this to ``localrc``:
 # enable_service swift
-ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,$DATABASE_TYPE
+ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,rabbit,tempest,$DATABASE_TYPE
 
 # Set the default Nova APIs to enable
 NOVA_ENABLED_APIS=ec2,osapi_compute,metadata
@@ -89,8 +89,8 @@
 QUANTUM_BRANCH=master
 
 # quantum client
-QUANTUM_CLIENT_REPO=${GIT_BASE}/openstack/python-quantumclient
-QUANTUM_CLIENT_BRANCH=master
+QUANTUMCLIENT_REPO=${GIT_BASE}/openstack/python-quantumclient
+QUANTUMCLIENT_BRANCH=master
 
 # Tempest test suite
 TEMPEST_REPO=${GIT_BASE}/openstack/tempest.git
diff --git a/tests/functions.sh b/tests/functions.sh
index d2cc5c4..be48729 100755
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -260,9 +260,11 @@
 if [[ "$os_PACKAGE" = "deb" ]]; then
     is_package_installed dpkg
     VAL=$?
-else
+elif [[ "$os_PACKAGE" = "rpm" ]]; then
     is_package_installed rpm
     VAL=$?
+else
+    VAL=1
 fi
 if [[ "$VAL" -eq 0 ]]; then
     echo "OK"
@@ -273,9 +275,11 @@
 if [[ "$os_PACKAGE" = "deb" ]]; then
     is_package_installed dpkg bash
     VAL=$?
-else
+elif [[ "$os_PACKAGE" = "rpm" ]]; then
     is_package_installed rpm bash
     VAL=$?
+else
+    VAL=1
 fi
 if [[ "$VAL" -eq 0 ]]; then
     echo "OK"
diff --git a/tools/info.sh b/tools/info.sh
index 583a994..f01dbea 100755
--- a/tools/info.sh
+++ b/tools/info.sh
@@ -90,15 +90,19 @@
 
 if is_ubuntu; then
     PKG_DIR=$FILES/apts
-else
+elif is_fedora; then
     PKG_DIR=$FILES/rpms
+else
+    exit_distro_not_supported "list of packages"
 fi
 
 for p in $(get_packages $PKG_DIR); do
     if [[ "$os_PACKAGE" = "deb" ]]; then
         ver=$(dpkg -s $p 2>/dev/null | grep '^Version: ' | cut -d' ' -f2)
-    else
+    elif [[ "$os_PACKAGE" = "rpm" ]]; then
         ver=$(rpm -q --queryformat "%{VERSION}-%{RELEASE}\n" $p)
+    else
+        exit_distro_not_supported "finding version of a package"
     fi
     echo "pkg|${p}|${ver}"
 done