Merge "Init default lvm volume group only if required"
diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst
index b9a4802..fe3e2c2 100644
--- a/doc/source/configuration.rst
+++ b/doc/source/configuration.rst
@@ -200,22 +200,19 @@
 
         LOG_COLOR=False
 
-Logging the Screen Output
--------------------------
+Logging the Service Output
+--------------------------
 
-    | *Default: ``SCREEN_LOGDIR=""``*
-    |  By default DevStack runs the OpenStack services using ``screen``
-       which is useful for watching log and debug output. However, in
-       automated testing the interactive ``screen`` sessions may not be
-       available after the fact; setting ``SCREEN_LOGDIR`` enables logging
-       of the ``screen`` sessions in the specified directory. There will be
-       one file per ``screen`` session named for the session name and a
-       timestamp.
+    | *Default: ``LOGDIR=""``*
+    |  DevStack will log the stdout output of the services it starts.
+       When using ``screen`` this logs the output in the screen windows
+       to a file.  Without ``screen`` this simply redirects stdout of
+       the service process to a file in ``LOGDIR``.
     |
 
     ::
 
-        SCREEN_LOGDIR=$DEST/logs/screen
+        LOGDIR=$DEST/logs
 
     *Note the use of ``DEST`` to locate the main install directory; this
     is why we suggest setting it in ``local.conf``.*
@@ -400,8 +397,8 @@
        FIXED_RANGE=10.254.1.0/24
        NETWORK_GATEWAY=10.254.1.1
        LOGDAYS=1
-       LOGFILE=$DEST/logs/stack.sh.log
-       SCREEN_LOGDIR=$DEST/logs/screen
+       LOGDIR=$DEST/logs
+       LOGFILE=$LOGDIR/stack.sh.log
        ADMIN_PASSWORD=quiet
        DATABASE_PASSWORD=$ADMIN_PASSWORD
        RABBIT_PASSWORD=$ADMIN_PASSWORD
diff --git a/doc/source/faq.rst b/doc/source/faq.rst
index 92d7945..f10c2ee 100644
--- a/doc/source/faq.rst
+++ b/doc/source/faq.rst
@@ -24,7 +24,7 @@
     by packaging in "real" deployments. To remove additional protections
     that will be desired/required in production would be a step
     backward.
-Q: But selinux is disabled in RHEL 6!
+Q: But selinux is disabled in RHEL!
     A: Today it is, yes. That is a specific exception that certain
     DevStack contributors fought strongly against. The primary reason it
     was allowed was to support using RHEL6 as the Python 2.6 test
@@ -70,11 +70,6 @@
 Q: Are there any differences between Ubuntu and Fedora support?
     A: Neutron is not fully supported prior to Fedora 18 due lack of
     OpenVSwitch packages.
-Q: How about RHEL 6?
-    A: RHEL 6 has Python 2.6 and many old modules packaged and is a
-    challenge to support. There are a number of specific RHEL6
-    work-arounds in ``stack.sh`` to handle this. But the testing on py26
-    is valuable so we do it...
 
 Operation and Configuration
 ===========================
diff --git a/files/apache-keystone.template b/files/apache-keystone.template
index 2190d83..504dc01 100644
--- a/files/apache-keystone.template
+++ b/files/apache-keystone.template
@@ -32,7 +32,3 @@
     %SSLCERTFILE%
     %SSLKEYFILE%
 </VirtualHost>
-
-# Workaround for missing path on RHEL6, see
-#  https://bugzilla.redhat.com/show_bug.cgi?id=1121019
-WSGISocketPrefix /var/run/%APACHE_NAME%
diff --git a/files/debs/glance b/files/debs/glance
index 15e09aa..8db8145 100644
--- a/files/debs/glance
+++ b/files/debs/glance
@@ -7,7 +7,6 @@
 python-routes
 python-greenlet
 python-sqlalchemy
-python-wsgiref
 python-pastedeploy
 python-xattr
 python-iso8601
diff --git a/files/patches/unittest2-discover.patch b/files/patches/unittest2-discover.patch
deleted file mode 100644
index 347300d..0000000
--- a/files/patches/unittest2-discover.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -r b2efb7df637b discover.py
---- a/discover.py	Thu Mar 24 00:31:02 2011 -0400
-+++ b/discover.py	Thu Nov 28 12:02:19 2013 +0000
-@@ -82,7 +82,11 @@
-     """
-     testMethodPrefix = 'test'
-     sortTestMethodsUsing = cmp
--    suiteClass = unittest.TestSuite
-+    try:
-+        import unittest2
-+        suiteClass = unittest2.TestSuite
-+    except ImportError:
-+        suiteClass = unittest.TestSuite
-     _top_level_dir = None
- 
-     def loadTestsFromTestCase(self, testCaseClass):
diff --git a/files/rpms-suse/glance b/files/rpms-suse/glance
index edd1564..9b962f9 100644
--- a/files/rpms-suse/glance
+++ b/files/rpms-suse/glance
@@ -8,5 +8,4 @@
 python-greenlet
 python-iso8601
 python-pyOpenSSL
-python-wsgiref
 python-xattr
diff --git a/files/rpms/cinder b/files/rpms/cinder
index eedff18..082a35a 100644
--- a/files/rpms/cinder
+++ b/files/rpms/cinder
@@ -3,4 +3,4 @@
 qemu-img
 postgresql-devel
 iscsi-initiator-utils
-python-lxml         #dist:f19,f20,f21,rhel7
+python-lxml
diff --git a/files/rpms/general b/files/rpms/general
index ee7cc12..13c8a87 100644
--- a/files/rpms/general
+++ b/files/rpms/general
@@ -13,7 +13,6 @@
 libxslt-devel
 psmisc
 pylint
-python-prettytable # dist:rhel6 [1]
 python-unittest2
 python-virtualenv
 python-devel
@@ -27,8 +26,3 @@
 libyaml-devel
 gettext  # used for compiling message catalogs
 net-tools
-
-# [1] : some of installed tools have unversioned dependencies on this,
-# but others have versioned (<=0.7).  So if a later version (0.7.1)
-# gets installed in response to an unversioned dependency, it breaks.
-# This pre-installs a compatible 0.6(ish) version from RHEL
diff --git a/files/rpms/glance b/files/rpms/glance
index d2792cf..a09b669 100644
--- a/files/rpms/glance
+++ b/files/rpms/glance
@@ -6,10 +6,9 @@
 python-argparse
 python-eventlet
 python-greenlet
-python-lxml         #dist:f19,f20,f21,rhel7
-python-paste-deploy #dist:f19,f20,f21,rhel7
+python-lxml
+python-paste-deploy
 python-routes
 python-sqlalchemy
-python-wsgiref      #dist:f18,f19,f20,f21
 pyxattr
 zlib-devel          # testonly
diff --git a/files/rpms/horizon b/files/rpms/horizon
index 82385ed..585c36c 100644
--- a/files/rpms/horizon
+++ b/files/rpms/horizon
@@ -12,8 +12,8 @@
 python-migrate
 python-mox
 python-nose
-python-paste        #dist:f19,f20,f21
-python-paste-deploy #dist:f19,f20,f21
+python-paste
+python-paste-deploy
 python-routes
 python-sqlalchemy
 python-webob
diff --git a/files/rpms/keystone b/files/rpms/keystone
index 8b0953d..45492e0 100644
--- a/files/rpms/keystone
+++ b/files/rpms/keystone
@@ -1,10 +1,10 @@
 MySQL-python
 python-greenlet
-libxslt-devel       # dist:f20,f21
-python-lxml         #dist:f19,f20,f21
-python-paste        #dist:f19,f20,f21
-python-paste-deploy #dist:f19,f20,f21
-python-paste-script #dist:f19,f20,f21
+libxslt-devel
+python-lxml
+python-paste
+python-paste-deploy
+python-paste-script
 python-routes
 python-sqlalchemy
 python-webob
diff --git a/files/rpms/neutron b/files/rpms/neutron
index 5450408..59152d6 100644
--- a/files/rpms/neutron
+++ b/files/rpms/neutron
@@ -12,9 +12,8 @@
 python-eventlet
 python-greenlet
 python-iso8601
-#rhel6 gets via pip
-python-paste        # dist:f19,f20,f21,rhel7
-python-paste-deploy # dist:f19,f20,f21,rhel7
+python-paste
+python-paste-deploy
 python-qpid # NOPRIME
 python-routes
 python-sqlalchemy
diff --git a/files/rpms/nova b/files/rpms/nova
index 07f13c7..557de90 100644
--- a/files/rpms/nova
+++ b/files/rpms/nova
@@ -29,11 +29,9 @@
 python-lockfile
 python-migrate
 python-mox
-python-paramiko # dist:f19,f20,f21,rhel7
-# ^ on RHEL6, brings in python-crypto which conflicts with version from
-# pip we need
-python-paste        # dist:f19,f20,f21,rhel7
-python-paste-deploy # dist:f19,f20,f21,rhel7
+python-paramiko
+python-paste
+python-paste-deploy
 python-qpid # NOPRIME
 python-routes
 python-sqlalchemy
diff --git a/files/rpms/swift b/files/rpms/swift
index ccda22b..0fcdb0f 100644
--- a/files/rpms/swift
+++ b/files/rpms/swift
@@ -6,7 +6,7 @@
 python-greenlet
 python-netifaces
 python-nose
-python-paste-deploy # dist:f19,f20,f21,rhel7
+python-paste-deploy
 python-simplejson
 python-webob
 pyxattr
diff --git a/functions-common b/functions-common
index f8b8eaf..4d1c89a 100644
--- a/functions-common
+++ b/functions-common
@@ -319,8 +319,8 @@
     set +o xtrace
     local msg="[ERROR] ${BASH_SOURCE[2]}:$1 $2"
     echo $msg 1>&2;
-    if [[ -n ${SCREEN_LOGDIR} ]]; then
-        echo $msg >> "${SCREEN_LOGDIR}/error.log"
+    if [[ -n ${LOGDIR} ]]; then
+        echo $msg >> "${LOGDIR}/error.log"
     fi
     $xtrace
     return $exitcode
@@ -372,8 +372,8 @@
     set +o xtrace
     local msg="[WARNING] ${BASH_SOURCE[2]}:$1 $2"
     echo $msg 1>&2;
-    if [[ -n ${SCREEN_LOGDIR} ]]; then
-        echo $msg >> "${SCREEN_LOGDIR}/error.log"
+    if [[ -n ${LOGDIR} ]]; then
+        echo $msg >> "${LOGDIR}/error.log"
     fi
     $xtrace
     return $exitcode
@@ -1261,8 +1261,8 @@
 # _run_process() is designed to be backgrounded by run_process() to simulate a
 # fork.  It includes the dirty work of closing extra filehandles and preparing log
 # files to produce the same logs as screen_it().  The log filename is derived
-# from the service name and global-and-now-misnamed ``SCREEN_LOGDIR``
-# Uses globals ``CURRENT_LOG_TIME``, ``SCREEN_LOGDIR``, ``SCREEN_NAME``, ``SERVICE_DIR``
+# from the service name.
+# Uses globals ``CURRENT_LOG_TIME``, ``LOGDIR``, ``SCREEN_LOGDIR``, ``SCREEN_NAME``, ``SERVICE_DIR``
 # If an optional group is provided sg will be used to set the group of
 # the command.
 # _run_process service "command-line" [group]
@@ -1277,9 +1277,14 @@
     exec 3>&-
     exec 6>&-
 
-    if [[ -n ${SCREEN_LOGDIR} ]]; then
-        exec 1>&${SCREEN_LOGDIR}/screen-${service}.log.${CURRENT_LOG_TIME} 2>&1
-        ln -sf ${SCREEN_LOGDIR}/screen-${service}.log.${CURRENT_LOG_TIME} ${SCREEN_LOGDIR}/screen-${service}.log
+    local real_logfile="${LOGDIR}/${service}.log.${CURRENT_LOG_TIME}"
+    if [[ -n ${LOGDIR} ]]; then
+        exec 1>&"$real_logfile" 2>&1
+        ln -sf "$real_logfile" ${LOGDIR}/${service}.log
+        if [[ -n ${SCREEN_LOGDIR} ]]; then
+            # Drop the backward-compat symlink
+            ln -sf "$real_logfile" ${SCREEN_LOGDIR}/screen-${service}.log
+        fi
 
         # TODO(dtroyer): Hack to get stdout from the Python interpreter for the logs.
         export PYTHONUNBUFFERED=1
@@ -1343,7 +1348,7 @@
 }
 
 # Helper to launch a process in a named screen
-# Uses globals ``CURRENT_LOG_TIME``, ``SCREEN_NAME``, ``SCREEN_LOGDIR``,
+# Uses globals ``CURRENT_LOG_TIME``, ```LOGDIR``, ``SCREEN_LOGDIR``, `SCREEN_NAME``,
 # ``SERVICE_DIR``, ``USE_SCREEN``
 # screen_process name "command-line" [group]
 # Run a command in a shell in a screen window, if an optional group
@@ -1362,10 +1367,18 @@
 
     screen -S $SCREEN_NAME -X screen -t $name
 
-    if [[ -n ${SCREEN_LOGDIR} ]]; then
-        screen -S $SCREEN_NAME -p $name -X logfile ${SCREEN_LOGDIR}/screen-${name}.log.${CURRENT_LOG_TIME}
+    local real_logfile="${LOGDIR}/${name}.log.${CURRENT_LOG_TIME}"
+    echo "LOGDIR: $LOGDIR"
+    echo "SCREEN_LOGDIR: $SCREEN_LOGDIR"
+    echo "log: $real_logfile"
+    if [[ -n ${LOGDIR} ]]; then
+        screen -S $SCREEN_NAME -p $name -X logfile "$real_logfile"
         screen -S $SCREEN_NAME -p $name -X log on
-        ln -sf ${SCREEN_LOGDIR}/screen-${name}.log.${CURRENT_LOG_TIME} ${SCREEN_LOGDIR}/screen-${name}.log
+        ln -sf "$real_logfile" ${LOGDIR}/${name}.log
+        if [[ -n ${SCREEN_LOGDIR} ]]; then
+            # Drop the backward-compat symlink
+            ln -sf "$real_logfile" ${SCREEN_LOGDIR}/screen-${1}.log
+        fi
     fi
 
     # sleep to allow bash to be ready to be send the command - we are
@@ -1410,8 +1423,8 @@
         echo "screen -t $1 bash" >> $SCREENRC
         echo "stuff \"$2$NL\"" >> $SCREENRC
 
-        if [[ -n ${SCREEN_LOGDIR} ]]; then
-            echo "logfile ${SCREEN_LOGDIR}/screen-${1}.log.${CURRENT_LOG_TIME}" >>$SCREENRC
+        if [[ -n ${LOGDIR} ]]; then
+            echo "logfile ${LOGDIR}/${1}.log.${CURRENT_LOG_TIME}" >>$SCREENRC
             echo "log on" >>$SCREENRC
         fi
     fi
diff --git a/lib/ceilometer b/lib/ceilometer
index d48751e..5d5b987 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -203,6 +203,8 @@
     iniset $CEILOMETER_CONF service_credentials os_username ceilometer
     iniset $CEILOMETER_CONF service_credentials os_password $SERVICE_PASSWORD
     iniset $CEILOMETER_CONF service_credentials os_tenant_name $SERVICE_TENANT_NAME
+    iniset $CEILOMETER_CONF service_credentials os_region_name $REGION_NAME
+    iniset $CEILOMETER_CONF service_credentials os_auth_url $KEYSTONE_SERVICE_URI/v2.0
 
     configure_auth_token_middleware $CEILOMETER_CONF ceilometer $CEILOMETER_AUTH_CACHE_DIR
 
diff --git a/lib/cinder b/lib/cinder
index 03e2e28..08f5874 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -303,18 +303,6 @@
         configure_cinder_driver
     fi
 
-    if is_fedora && [[ $DISTRO =~ (rhel6) ]]; then
-        # Cinder clones are slightly larger due to some extra
-        # metadata.  RHEL6 will not allow auto-extending of LV's
-        # without this, leading to clones giving hard-to-track disk
-        # I/O errors.
-        # see https://bugzilla.redhat.com/show_bug.cgi?id=975052
-        sudo sed -i~ \
-            -e 's/snapshot_autoextend_threshold =.*/snapshot_autoextend_threshold = 80/' \
-            -e 's/snapshot_autoextend_percent =.*/snapshot_autoextend_percent = 20/' \
-            /etc/lvm/lvm.conf
-    fi
-
     iniset $CINDER_CONF DEFAULT osapi_volume_workers "$API_WORKERS"
 
     iniset $CINDER_CONF DEFAULT glance_api_servers "${GLANCE_SERVICE_PROTOCOL}://${GLANCE_HOSTPORT}"
@@ -395,9 +383,15 @@
 
     if is_service_enabled c-vol && [[ -n "$CINDER_ENABLED_BACKENDS" ]]; then
         local be be_name be_type
+        local has_lvm=0
         for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
             be_type=${be%%:*}
             be_name=${be##*:}
+
+            if [[ $be_type == 'lvm' ]]; then
+                has_lvm=1
+            fi
+
             if type init_cinder_backend_${be_type} >/dev/null 2>&1; then
                 # Always init the default volume group for lvm.
                 if [[ "$be_type" == "lvm" ]]; then
@@ -408,6 +402,17 @@
         done
     fi
 
+    # Keep it simple, set a marker if there's an LVM backend
+    # use the created VG's to setup lvm filters
+    if [[ $has_lvm == 1 ]]; then
+        # Order matters here, not only obviously to make
+        # sure the VG's are created, but also some distros
+        # do some customizations to lvm.conf on init, we
+        # want to make sure we copy those over
+        sudo cp /etc/lvm/lvm.conf /etc/cinder/lvm.conf
+        configure_cinder_backend_conf_lvm
+    fi
+
     mkdir -p $CINDER_STATE_PATH/volumes
     create_cinder_cache_dir
 }
@@ -450,12 +455,8 @@
         if is_ubuntu; then
             sudo service tgt restart
         elif is_fedora; then
-            if [[ $DISTRO =~ (rhel6) ]]; then
-                sudo /sbin/service tgtd restart
-            else
-                # bypass redirection to systemctl during restart
-                sudo /sbin/service --skip-redirect tgtd restart
-            fi
+            # bypass redirection to systemctl during restart
+            sudo /sbin/service --skip-redirect tgtd restart
         elif is_suse; then
             restart_service tgtd
         else
diff --git a/lib/cinder_backends/lvm b/lib/cinder_backends/lvm
index 43e13e4..4b9d8dc 100644
--- a/lib/cinder_backends/lvm
+++ b/lib/cinder_backends/lvm
@@ -19,6 +19,7 @@
 # clean_cinder_backend_lvm - called from clean_cinder()
 # configure_cinder_backend_lvm - called from configure_cinder()
 # init_cinder_backend_lvm - called from init_cinder()
+# configure_cinder_backend_conf_lvm - called from configure_cinder()
 
 
 # Save trace setting
@@ -47,8 +48,9 @@
     local be_name=$1
 
     iniset $CINDER_CONF $be_name volume_backend_name $be_name
-    iniset $CINDER_CONF $be_name volume_driver "cinder.volume.drivers.lvm.LVMISCSIDriver"
+    iniset $CINDER_CONF $be_name volume_driver "cinder.volume.drivers.lvm.LVMVolumeDriver"
     iniset $CINDER_CONF $be_name volume_group $VOLUME_GROUP_NAME-$be_name
+    iniset $CINDER_CONF $be_name iscsi_helper "tgtadm"
 
     if [[ "$CINDER_SECURE_DELETE" == "False" ]]; then
         iniset $CINDER_CONF $be_name volume_clear none
@@ -64,6 +66,35 @@
     init_lvm_volume_group $VOLUME_GROUP_NAME-$be_name $VOLUME_BACKING_FILE_SIZE
 }
 
+# configure_cinder_backend_conf_lvm - Sets device filter in /etc/cinder/lvm.conf
+# init_cinder_backend_lvm
+function configure_cinder_backend_conf_lvm {
+    local filter_suffix='"r/.*/" ]'
+    local filter_string="filter = [ "
+    local conf_entries=$(grep volume_group /etc/cinder/cinder.conf | sed "s/ //g")
+    local pv
+    local vg
+    local line
+
+    for pv_info in $(sudo pvs --noheadings -o name,vg_name --separator ';'); do
+        IFS=';' read pv vg <<< $pv_info
+        for line in ${conf_entries}; do
+            IFS='=' read label group <<< $line
+            group=$(echo $group|sed "s/^ *//g")
+            if [[ "$vg" == "$group" ]]; then
+                new="\"a$pv/\", "
+                filter_string=$filter_string$new
+            fi
+        done
+    done
+    filter_string=$filter_string$filter_suffix
+
+    # FIXME(jdg): Possible odd case that the lvm.conf file has been modified
+    # and doesn't have a filter entry to search/replace.  For devstack don't
+    # know that we care, but could consider adding a check and add
+    sudo sed -i "s#^[ \t]*filter.*#    $filter_string#g" /etc/cinder/lvm.conf
+    echo "set LVM filter_strings: $filter_string"
+}
 # Restore xtrace
 $MY_XTRACE
 
diff --git a/lib/databases/mysql b/lib/databases/mysql
index 2f3b6d4..72c0f82 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -17,11 +17,7 @@
 # Linux distros, thank you for being incredibly consistent
 MYSQL=mysql
 if is_fedora; then
-    if [[ $DISTRO =~ (rhel6) ]]; then
-        MYSQL=mysqld
-    else
-        MYSQL=mariadb
-    fi
+    MYSQL=mariadb
 fi
 
 # Functions
@@ -38,15 +34,9 @@
         sudo rm -rf /etc/mysql
         return
     elif is_fedora; then
-        if [[ $DISTRO =~ (rhel6) ]]; then
-            stop_service mysqld
-            uninstall_package mysql-server
-            sudo rm -rf /var/lib/mysql
-        else
-            stop_service mariadb
-            uninstall_package mariadb-server
-            sudo rm -rf /var/lib/mysql
-        fi
+        stop_service mariadb
+        uninstall_package mariadb-server
+        sudo rm -rf /var/lib/mysql
     elif is_suse; then
         stop_service mysql
         uninstall_package mysql-community-server
@@ -70,11 +60,7 @@
         my_conf=/etc/mysql/my.cnf
         mysql=mysql
     elif is_fedora; then
-        if [[ $DISTRO =~ (rhel6) ]]; then
-            mysql=mysqld
-        else
-            mysql=mariadb
-        fi
+        mysql=mariadb
         my_conf=/etc/my.cnf
     elif is_suse; then
         my_conf=/etc/my.cnf
@@ -110,7 +96,7 @@
 
     if [[ "$DATABASE_QUERY_LOGGING" == "True" ]]; then
         echo_summary "Enabling MySQL query logging"
-        if is_fedora && ! [[ $DISTRO =~ (rhel6) ]]; then
+        if is_fedora; then
             slow_log=/var/log/mariadb/mariadb-slow.log
         else
             slow_log=/var/log/mysql/mysql-slow.log
@@ -158,11 +144,7 @@
     fi
     # Install mysql-server
     if is_fedora; then
-        if [[ $DISTRO =~ (rhel6) ]]; then
-            install_package mysql-server
-        else
-            install_package mariadb-server
-        fi
+        install_package mariadb-server
     elif is_ubuntu; then
         install_package mysql-server
     elif is_suse; then
diff --git a/lib/databases/postgresql b/lib/databases/postgresql
index ad8cdc7..317e0eb 100644
--- a/lib/databases/postgresql
+++ b/lib/databases/postgresql
@@ -49,11 +49,7 @@
         pg_hba=/var/lib/pgsql/data/pg_hba.conf
         pg_conf=/var/lib/pgsql/data/postgresql.conf
         if ! sudo [ -e $pg_hba ]; then
-            if ! [[ $DISTRO =~ (rhel6) ]]; then
-                sudo postgresql-setup initdb
-            else
-                sudo service postgresql initdb
-            fi
+            sudo postgresql-setup initdb
         fi
     elif is_ubuntu; then
         pg_dir=`find /etc/postgresql -name pg_hba.conf|xargs dirname`
diff --git a/lib/dstat b/lib/dstat
index a17125f..d1db469 100644
--- a/lib/dstat
+++ b/lib/dstat
@@ -27,8 +27,12 @@
 function start_dstat {
     # A better kind of sysstat, with the top process per time slice
     DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv"
-    if [[ -n ${SCREEN_LOGDIR} ]]; then
-        screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $SCREEN_LOGDIR/$DSTAT_FILE"
+    if [[ -n ${LOGDIR} ]]; then
+        screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $LOGDIR/$DSTAT_FILE"
+        if [[ -n ${SCREEN_LOGDIR} ]]; then
+            # Drop the backward-compat symlink
+            ln -sf $LOGDIR/$DSTAT_FILE ${SCREEN_LOGDIR}/$DSTAT_FILE
+        fi
     else
         screen_it dstat "dstat $DSTAT_OPTS"
     fi
diff --git a/lib/heat b/lib/heat
index 813c2fe..82bbc9f 100644
--- a/lib/heat
+++ b/lib/heat
@@ -10,6 +10,7 @@
 # Dependencies:
 #
 # - functions
+# - dib (if HEAT_CREATE_TEST_IMAGE=True)
 
 # stack.sh
 # ---------
@@ -46,6 +47,11 @@
 HEAT_STACK_DOMAIN=$(trueorfalse True HEAT_STACK_DOMAIN)
 HEAT_API_HOST=${HEAT_API_HOST:-$HOST_IP}
 HEAT_API_PORT=${HEAT_API_PORT:-8004}
+HEAT_FUNCTIONAL_IMAGE_ELEMENTS=${HEAT_FUNCTIONAL_IMAGE_ELEMENTS:-\
+vm fedora selinux-permissive pypi  os-collect-config os-refresh-config \
+os-apply-config heat-cfntools heat-config heat-config-cfn-init \
+heat-config-puppet heat-config-script}
+
 
 # other default options
 HEAT_DEFERRED_AUTH=${HEAT_DEFERRED_AUTH:-trusts}
@@ -301,19 +307,20 @@
 
 # build_heat_functional_test_image() - Build and upload functional test image
 function build_heat_functional_test_image {
-    build_dib_pip_repo "$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR"
-    local image_name=heat-functional-tests-image
+    if is_service_enabled dib; then
+        build_dib_pip_repo "$OCC_DIR $OAC_DIR $ORC_DIR $HEAT_CFNTOOLS_DIR"
+        local image_name=heat-functional-tests-image
 
-    # The elements to invoke disk-image-create with
-    local image_elements="vm fedora selinux-permissive pypi \
-        os-collect-config os-refresh-config os-apply-config heat-cfntools \
-        heat-config heat-config-cfn-init heat-config-puppet heat-config-script"
+        # Elements path for tripleo-image-elements and heat-templates software-config
+        local elements_path=$TIE_DIR/elements:$HEAT_TEMPLATES_REPO_DIR/hot/software-config/elements
 
-    # Elements path for tripleo-image-elements and heat-templates software-config
-    local elements_path=$TIE_DIR/elements:$HEAT_TEMPLATES_REPO_DIR/hot/software-config/elements
-
-    disk_image_create_upload "$image_name" "$image_elements" "$elements_path"
-    iniset $TEMPEST_CONFIG orchestration image_ref $image_name
+        disk_image_create_upload "$image_name" "$HEAT_FUNCTIONAL_IMAGE_ELEMENTS" "$elements_path"
+        iniset $TEMPEST_CONFIG orchestration image_ref $image_name
+    else
+        echo "Error, HEAT_CREATE_TEST_IMAGE=True requires dib" >&2
+        echo "Add \"enable_service dib\" to your localrc" >&2
+        exit 1
+    fi
 }
 
 # Restore xtrace
diff --git a/lib/horizon b/lib/horizon
index aa70bd5..122d516 100644
--- a/lib/horizon
+++ b/lib/horizon
@@ -72,14 +72,6 @@
 # cleanup_horizon() - Remove residual data files, anything left over from previous
 # runs that a clean run would need to clean up
 function cleanup_horizon {
-    if is_fedora && [[ $DISTRO =~ (rhel6) ]]; then
-        # If ``/usr/bin/node`` points into ``$DEST``
-        # we installed it via ``install_nodejs``
-        if [[ $(readlink -f /usr/bin/node) =~ ($DEST) ]]; then
-            sudo rm /usr/bin/node
-        fi
-    fi
-
     local horizon_conf=$(apache_site_config_for horizon)
     sudo rm -f $horizon_conf
 }
diff --git a/lib/neutron b/lib/neutron
index b22c00b..0f49476 100755
--- a/lib/neutron
+++ b/lib/neutron
@@ -1026,6 +1026,7 @@
     iniset $NEUTRON_CONF DEFAULT notify_nova_on_port_status_changes $Q_NOTIFY_NOVA_PORT_STATUS_CHANGES
     iniset $NEUTRON_CONF DEFAULT notify_nova_on_port_data_changes $Q_NOTIFY_NOVA_PORT_DATA_CHANGES
     iniset $NEUTRON_CONF DEFAULT nova_url "$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST:$NOVA_SERVICE_PORT/v2"
+    iniset $NEUTRON_CONF DEFAULT nova_region_name $REGION_NAME
     iniset $NEUTRON_CONF DEFAULT nova_admin_username nova
     iniset $NEUTRON_CONF DEFAULT nova_admin_password $SERVICE_PASSWORD
     ADMIN_TENANT_ID=$(openstack project list | awk "/ service / { print \$2 }")
diff --git a/lib/nova_plugins/functions-libvirt b/lib/nova_plugins/functions-libvirt
index c136e35..4d617e8 100644
--- a/lib/nova_plugins/functions-libvirt
+++ b/lib/nova_plugins/functions-libvirt
@@ -37,8 +37,7 @@
 
     # Note there is a difference between F20 rackspace cloud images
     # and HP images used in the gate; rackspace has firewalld but hp
-    # cloud doesn't.  RHEL6 doesn't have firewalld either.  So we
-    # don't care if it fails.
+    # cloud doesn't.
     if is_fedora && is_package_installed firewalld; then
         sudo service firewalld restart || true
     fi
@@ -68,34 +67,12 @@
     fi
 
     if is_fedora || is_suse; then
-        if is_fedora && [[ $DISTRO =~ (rhel6) || "$os_RELEASE" -le "17" ]]; then
-            cat <<EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
-[libvirt Management Access]
-Identity=unix-group:$LIBVIRT_GROUP
-Action=org.libvirt.unix.manage
-ResultAny=yes
-ResultInactive=yes
-ResultActive=yes
-EOF
-        elif is_suse && [[ $os_RELEASE = 12.2 || "$os_VENDOR" = "SUSE LINUX" ]]; then
-            # openSUSE < 12.3 or SLE
-            # Work around the fact that polkit-default-privs overrules pklas
-            # with 'unix-group:$group'.
-            cat <<EOF | sudo tee /etc/polkit-1/localauthority/50-local.d/50-libvirt-remote-access.pkla
-[libvirt Management Access]
-Identity=unix-user:$STACK_USER
-Action=org.libvirt.unix.manage
-ResultAny=yes
-ResultInactive=yes
-ResultActive=yes
-EOF
-        else
-            # Starting with fedora 18 and opensuse-12.3 enable stack-user to
-            # virsh -c qemu:///system by creating a policy-kit rule for
-            # stack-user using the new Javascript syntax
-            rules_dir=/etc/polkit-1/rules.d
-            sudo mkdir -p $rules_dir
-            cat <<EOF | sudo tee $rules_dir/50-libvirt-$STACK_USER.rules
+        # Starting with fedora 18 and opensuse-12.3 enable stack-user to
+        # virsh -c qemu:///system by creating a policy-kit rule for
+        # stack-user using the new Javascript syntax
+        rules_dir=/etc/polkit-1/rules.d
+        sudo mkdir -p $rules_dir
+        cat <<EOF | sudo tee $rules_dir/50-libvirt-$STACK_USER.rules
 polkit.addRule(function(action, subject) {
     if (action.id == 'org.libvirt.unix.manage' &&
         subject.user == '$STACK_USER') {
@@ -103,8 +80,7 @@
     }
 });
 EOF
-            unset rules_dir
-        fi
+        unset rules_dir
     fi
 
     # The user that nova runs as needs to be member of **libvirtd** group otherwise
diff --git a/stack.sh b/stack.sh
index db36367..198a347 100755
--- a/stack.sh
+++ b/stack.sh
@@ -152,7 +152,7 @@
 
 # Warn users who aren't on an explicitly supported distro, but allow them to
 # override check and attempt installation with ``FORCE=yes ./stack``
-if [[ ! ${DISTRO} =~ (precise|trusty|7.0|wheezy|sid|testing|jessie|f20|f21|rhel6|rhel7) ]]; then
+if [[ ! ${DISTRO} =~ (precise|trusty|7.0|wheezy|sid|testing|jessie|f20|f21|rhel7) ]]; then
     echo "WARNING: this script has not been tested on $DISTRO"
     if [[ "$FORCE" != "yes" ]]; then
         die $LINENO "If you wish to run this script anyway run with FORCE=yes"
@@ -221,7 +221,7 @@
 # Some distros need to add repos beyond the defaults provided by the vendor
 # to pick up required packages.
 
-if is_fedora && [[ $DISTRO == "rhel6" || $DISTRO == "rhel7" ]]; then
+if is_fedora && [[ $DISTRO == "rhel7" ]]; then
     # RHEL requires EPEL for many Open Stack dependencies
 
     # note we always remove and install latest -- some environments
@@ -239,16 +239,10 @@
     # $releasever directly in .repo file we create below.  However
     # RHEL gives a $releasever of "6Server" which breaks the path;
     # see https://bugzilla.redhat.com/show_bug.cgi?id=1150759
-    if [[ $DISTRO == "rhel7" ]]; then
-        epel_ver="7"
-    elif [[ $DISTRO == "rhel6" ]]; then
-        epel_ver="6"
-    fi
-
     cat <<EOF | sudo tee /etc/yum.repos.d/epel-bootstrap.repo
 [epel-bootstrap]
 name=Bootstrap EPEL
-mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-$epel_ver&arch=\$basearch
+mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-7&arch=\$basearch
 failovermethod=priority
 enabled=0
 gpgcheck=0
@@ -261,22 +255,10 @@
 
     # ... and also optional to be enabled
     is_package_installed yum-utils || install_package yum-utils
-    if [[ $DISTRO == "rhel7" ]]; then
-        OPTIONAL_REPO=rhel-7-server-optional-rpms
-    elif [[ $DISTRO == "rhel6" ]]; then
-        OPTIONAL_REPO=rhel-6-server-optional-rpms
-    fi
-    sudo yum-config-manager --enable ${OPTIONAL_REPO}
+    sudo yum-config-manager --enable rhel-7-server-optional-rpms
 
-    # Installing Open vSwitch on RHEL requires enabling the RDO repo.
-    # Note no juno packages for rhel6
-    if [[ $DISTRO == "rhel6" ]]; then
-        RHEL_RDO_REPO_RPM=${RHEL6_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-icehouse/rdo-release-icehouse-4.noarch.rpm"}
-        RHEL_RDO_REPO_ID=${RHEL6_RDO_REPO_ID:-"openstack-icehouse"}
-    elif [[ $DISTRO == "rhel7" ]]; then
-        RHEL_RDO_REPO_RPM=${RHEL7_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm"}
-        RHEL_RDO_REPO_ID=${RHEL7_RDO_REPO_ID:-"openstack-juno"}
-    fi
+    RHEL_RDO_REPO_RPM=${RHEL7_RDO_REPO_RPM:-"https://repos.fedorapeople.org/repos/openstack/openstack-juno/rdo-release-juno-1.noarch.rpm"}
+    RHEL_RDO_REPO_ID=${RHEL7_RDO_REPO_ID:-"openstack-juno"}
 
     if ! sudo yum repolist enabled $RHEL_RDO_REPO_ID | grep -q $RHEL_RDO_REPO_ID; then
         echo "RDO repo not detected; installing"
@@ -362,20 +344,16 @@
     echo $@ >&3
 }
 
-if is_fedora && [ $DISTRO == "rhel6" ]; then
-    # poor old python2.6 doesn't have argparse by default, which
-    # outfilter.py uses
-    is_package_installed python-argparse || install_package python-argparse
-fi
-
 # Set up logging for ``stack.sh``
 # Set ``LOGFILE`` to turn on logging
 # Append '.xxxxxxxx' to the given name to maintain history
 # where 'xxxxxxxx' is a representation of the date the file was created
 TIMESTAMP_FORMAT=${TIMESTAMP_FORMAT:-"%F-%H%M%S"}
-if [[ -n "$LOGFILE" || -n "$SCREEN_LOGDIR" ]]; then
-    LOGDAYS=${LOGDAYS:-7}
-    CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT")
+LOGDAYS=${LOGDAYS:-7}
+CURRENT_LOG_TIME=$(date "+$TIMESTAMP_FORMAT")
+
+if [[ -n ${LOGDIR:-} ]]; then
+    mkdir -p $LOGDIR
 fi
 
 if [[ -n "$LOGFILE" ]]; then
@@ -428,6 +406,7 @@
 # ``screen-$SERVICE_NAME-$TIMESTAMP.log`` in that dir and have a link
 # ``screen-$SERVICE_NAME.log`` to the latest log file.
 # Logs are kept for as long specified in ``LOGDAYS``.
+# This is deprecated....logs go in ``LOGDIR``, only symlinks will be here now.
 if [[ -n "$SCREEN_LOGDIR" ]]; then
 
     # We make sure the directory is created.
diff --git a/stackrc b/stackrc
index 2dd56e8..ff82140 100644
--- a/stackrc
+++ b/stackrc
@@ -705,6 +705,53 @@
 
 # Following entries need to be last items in file
 
+# Compatibility bits required by other callers like Grenade
+
+# Old way was using SCREEN_LOGDIR to locate those logs and LOGFILE for the stack.sh trace log.
+# LOGFILE       SCREEN_LOGDIR       output
+# not set       not set             no log files
+# set           not set             stack.sh log to LOGFILE
+# not set       set                 screen logs to SCREEN_LOGDIR
+# set           set                 stack.sh log to LOGFILE, screen logs to SCREEN_LOGDIR
+
+# New way is LOGDIR for all logs and LOGFILE for stack.sh trace log, but if not fully-qualified will be in LOGDIR
+# LOGFILE       LOGDIR              output
+# not set       not set             (new) set LOGDIR from default
+# set           not set             stack.sh log to LOGFILE, (new) set LOGDIR from LOGFILE
+# not set       set                 screen logs to LOGDIR
+# set           set                 stack.sh log to LOGFILE, screen logs to LOGDIR
+
+# For compat, if SCREEN_LOGDIR is set, it will be used to create back-compat symlinks to the LOGDIR
+# symlinks to SCREEN_LOGDIR (compat)
+
+
+# Set up new logging defaults
+if [[ -z "${LOGDIR:-}" ]]; then
+    default_logdir=$DEST/logs
+    if [[ -z "${LOGFILE:-}" ]]; then
+        # Nothing is set, we need a default
+        LOGDIR="$default_logdir"
+    else
+        # Set default LOGDIR
+        LOGDIR="${LOGFILE%/*}"
+        logfile="${LOGFILE##*/}"
+        if [[ -z "$LOGDIR" || "$LOGDIR" == "$logfile" ]]; then
+            # LOGFILE had no path, set a default
+            LOGDIR="$default_logdir"
+        fi
+
+        # Check for duplication
+        if [[ "${SCREEN_LOGDIR:-}" == "${LOGDIR}" ]]; then
+            # We don't need the symlinks since it's the same directory
+            unset SCREEN_LOGDIR
+        fi
+    fi
+    unset default_logdir logfile
+fi
+
+# LOGDIR is always set at this point so it is not useful as a 'enable' for service logs
+# SCREEN_LOGDIR may be set, it is useful to enable the compat symlinks
+
 # Local variables:
 # mode: shell-script
 # End:
diff --git a/tools/fixup_stuff.sh b/tools/fixup_stuff.sh
index c7f1efa..cc5275f 100755
--- a/tools/fixup_stuff.sh
+++ b/tools/fixup_stuff.sh
@@ -12,12 +12,10 @@
 # - httplib2 0.8 permissions are 600 in the package and
 #   pip 1.4 doesn't fix it (1.3 did)
 #
-# - RHEL6:
-#
+# - Fedora:
 #   - set selinux not enforcing
-#   - (re)start messagebus daemon
-#   - remove distro packages python-crypto and python-lxml
-#   - pre-install hgtools to work around a bug in RHEL6 distribute
+#   - uninstall firewalld (f20 only)
+
 
 # If TOP_DIR is set we're being sourced rather than running stand-alone
 # or in a sub-shell
@@ -125,64 +123,3 @@
     fi
 
 fi
-
-# RHEL6
-# -----
-
-if [[ $DISTRO =~ (rhel6) ]]; then
-
-    # install_pip.sh installs the latest setuptools over the packaged
-    # version.  We can't really uninstall the packaged version if it
-    # is there, because it may remove other important things like
-    # cloud-init.  Things work, but there can be an old egg file left
-    # around from the package that causes some really strange
-    # setuptools errors.  Remove it, if it is there
-    sudo rm -f /usr/lib/python2.6/site-packages/setuptools-0.6*.egg-info
-
-    # If the ``dbus`` package was installed by DevStack dependencies the
-    # uuid may not be generated because the service was never started (PR#598200),
-    # causing Nova to stop later on complaining that ``/var/lib/dbus/machine-id``
-    # does not exist.
-    sudo service messagebus restart
-
-    # The following workarounds break xenserver
-    if [ "$VIRT_DRIVER" != 'xenserver' ]; then
-        # An old version of ``python-crypto`` (2.0.1) may be installed on a
-        # fresh system via Anaconda and the dependency chain
-        # ``cas`` -> ``python-paramiko`` -> ``python-crypto``.
-        # ``pip uninstall pycrypto`` will remove the packaged ``.egg-info``
-        # file but leave most of the actual library files behind in
-        # ``/usr/lib64/python2.6/Crypto``. Later ``pip install pycrypto``
-        # will install over the packaged files resulting
-        # in a useless mess of old, rpm-packaged files and pip-installed files.
-        # Remove the package so that ``pip install python-crypto`` installs
-        # cleanly.
-        # Note: other RPM packages may require ``python-crypto`` as well.
-        # For example, RHEL6 does not install ``python-paramiko packages``.
-        uninstall_package python-crypto
-
-        # A similar situation occurs with ``python-lxml``, which is required by
-        # ``ipa-client``, an auditing package we don't care about.  The
-        # build-dependencies needed for ``pip install lxml`` (``gcc``,
-        # ``libxml2-dev`` and ``libxslt-dev``) are present in
-        # ``files/rpms/general``.
-        uninstall_package python-lxml
-    fi
-
-    # ``setup.py`` contains a ``setup_requires`` package that is supposed
-    # to be transient.  However, RHEL6 distribute has a bug where
-    # ``setup_requires`` registers entry points that are not cleaned
-    # out properly after the setup-phase resulting in installation failures
-    # (bz#924038).  Pre-install the problem package so the ``setup_requires``
-    # dependency is satisfied and it will not be installed transiently.
-    # Note we do this before the track-depends in ``stack.sh``.
-    pip_install hgtools
-
-    # workaround for https://code.google.com/p/unittest-ext/issues/detail?id=79
-    install_package python-unittest2 patch
-    pip_install discover
-    (cd /usr/lib/python2.6/site-packages/; sudo patch <"$FILES/patches/unittest2-discover.patch" || echo 'Assume already applied')
-    # Make sure the discover.pyc is up to date
-    sudo rm /usr/lib/python2.6/site-packages/discover.pyc || true
-    sudo python -c 'import discover'
-fi
diff --git a/tools/install_pip.sh b/tools/install_pip.sh
index d57a687..73d0947 100755
--- a/tools/install_pip.sh
+++ b/tools/install_pip.sh
@@ -43,7 +43,7 @@
 
 function install_get_pip {
     if [[ ! -r $LOCAL_PIP ]]; then
-        curl -o $LOCAL_PIP $PIP_GET_PIP_URL || \
+        curl --retry 6 --retry-delay 5 -o $LOCAL_PIP $PIP_GET_PIP_URL || \
             die $LINENO "Download of get-pip.py failed"
     fi
     sudo -H -E python $LOCAL_PIP