Merge "Copy neutron service conf files into NEUTRON_CONF_DIR"
diff --git a/HACKING.rst b/HACKING.rst
index b7d9a49..dcde141 100644
--- a/HACKING.rst
+++ b/HACKING.rst
@@ -20,7 +20,7 @@
 contains the usual links for blueprints, bugs, etc.
 
 __ contribute_
-.. _contribute: http://wiki.openstack.org/HowToContribute
+.. _contribute: http://docs.openstack.org/infra/manual/developers.html
 
 __ lp_
 .. _lp: https://launchpad.net/~devstack
diff --git a/doc/source/contributing.rst b/doc/source/contributing.rst
index b2a219b..50c0100 100644
--- a/doc/source/contributing.rst
+++ b/doc/source/contributing.rst
@@ -3,9 +3,9 @@
 ============
 
 DevStack uses the standard OpenStack contribution process as outlined in
-`the OpenStack wiki 'How To
-Contribute' <https://wiki.openstack.org/wiki/How_To_Contribute>`__. This
-means that you will need to meet the requirements of the Contributors
+`the OpenStack developer
+guide <http://docs.openstack.org/infra/manual/developers.html>`__. This
+means that you will need to meet the requirements of the Contribututors
 License Agreement (CLA). If you have already done that for another
 OpenStack project you are good to go.
 
diff --git a/doc/source/faq.rst b/doc/source/faq.rst
index f10c2ee..fd9c736 100644
--- a/doc/source/faq.rst
+++ b/doc/source/faq.rst
@@ -46,8 +46,8 @@
     `git.openstack.org <https://git.openstack.org/cgit/openstack-dev/devstack>`__
     and bug reports go to
     `LaunchPad <http://bugs.launchpad.net/devstack/>`__. Contributions
-    follow the usual process as described in the `OpenStack
-    wiki <http://wiki.openstack.org/HowToContribute>`__. This Sphinx
+    follow the usual process as described in the `developer
+    guide <http://docs.openstack.org/infra/manual/developers.html>`__. This Sphinx
     documentation is housed in the doc directory.
 Q: Why not use packages?
     A: Unlike packages, DevStack leaves your cloud ready to develop -
diff --git a/doc/source/guides/single-vm.rst b/doc/source/guides/single-vm.rst
index a41c4e1..ab46d91 100644
--- a/doc/source/guides/single-vm.rst
+++ b/doc/source/guides/single-vm.rst
@@ -15,7 +15,7 @@
 ---------------
 
 DevStack should run in any virtual machine running a supported Linux
-release. It will perform best with 2Gb or more of RAM.
+release. It will perform best with 4Gb or more of RAM.
 
 OpenStack Deployment & cloud-init
 ---------------------------------
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 7188f6e..0763fb8 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -19,7 +19,7 @@
 
 #. Select a Linux Distribution
 
-   Only Ubuntu 14.04 (Trusty), Fedora 20 and CentOS/RHEL 6.5 are
+   Only Ubuntu 14.04 (Trusty), Fedora 20 and CentOS/RHEL 7 are
    documented here. OpenStack also runs and is packaged on other flavors
    of Linux such as OpenSUSE and Debian.
 
diff --git a/files/debs/q-l3 b/files/debs/q-l3
index b98b628..106a6a3 100644
--- a/files/debs/q-l3
+++ b/files/debs/q-l3
@@ -1,2 +1,3 @@
+conntrack
 conntrackd
 keepalived
diff --git a/functions-common b/functions-common
index 4d1c89a..b92fa55 100644
--- a/functions-common
+++ b/functions-common
@@ -245,7 +245,7 @@
     set +o xtrace
     local default=$1
     local literal=$2
-    local testval=${!literal}
+    local testval=${!literal:-}
 
     [[ -z "$testval" ]] && { echo "$default"; return; }
     [[ "0 no No NO false False FALSE" =~ "$testval" ]] && { echo "False"; return; }
diff --git a/lib/dib b/lib/dib
index 809217b..88d9fd8 100644
--- a/lib/dib
+++ b/lib/dib
@@ -35,15 +35,6 @@
 ORC_DIR=$DEST/os-refresh-config
 OAC_DIR=$DEST/os-apply-config
 
-# Include the apt-sources element in builds if we have an
-# alternative sources.list specified.
-if [ -n "$DIB_APT_SOURCES" ]; then
-    if [ ! -e "$DIB_APT_SOURCES" ]; then
-        die $LINENO "DIB_APT_SOURCES set but not found at $DIB_APT_SOURCES"
-    fi
-    EXTRA_ELEMENTS="apt-sources"
-fi
-
 # Functions
 # ---------
 
@@ -106,6 +97,15 @@
 
     local image_path=$TOP_DIR/files/$image_name.qcow2
 
+    # Include the apt-sources element in builds if we have an
+    # alternative sources.list specified.
+    if [ -n "$DIB_APT_SOURCES" ]; then
+        if [ ! -e "$DIB_APT_SOURCES" ]; then
+            die $LINENO "DIB_APT_SOURCES set but not found at $DIB_APT_SOURCES"
+        fi
+        local extra_elements="apt-sources"
+    fi
+
     # Set the local pip repo as the primary index mirror so the
     # image is built with local packages
     local pypi_mirror_url=http://$SERVICE_HOST:$DIB_PIP_REPO_PORT/
@@ -127,7 +127,7 @@
     DIB_OFFLINE=$DIB_BUILD_OFFLINE \
     PYPI_MIRROR_URL=$pypi_mirror_url \
     PYPI_MIRROR_URL_1=$pypi_mirror_url_1 \
-    disk-image-create -a amd64 $image_elements $EXTRA_ELEMENTS \
+    disk-image-create -a amd64 $image_elements ${extra_elements:-} \
         --image-cache $DIB_IMAGE_CACHE \
         -o $image_path
 
diff --git a/lib/dstat b/lib/dstat
index d1db469..8165e5c 100644
--- a/lib/dstat
+++ b/lib/dstat
@@ -29,7 +29,7 @@
     DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv"
     if [[ -n ${LOGDIR} ]]; then
         screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $LOGDIR/$DSTAT_FILE"
-        if [[ -n ${SCREEN_LOGDIR} ]]; then
+        if [[ -n ${SCREEN_LOGDIR} && ${SCREEN_LOGDIR} != ${LOGDIR} ]]; then
             # Drop the backward-compat symlink
             ln -sf $LOGDIR/$DSTAT_FILE ${SCREEN_LOGDIR}/$DSTAT_FILE
         fi
diff --git a/lib/heat b/lib/heat
index 82bbc9f..bbef08c 100644
--- a/lib/heat
+++ b/lib/heat
@@ -150,6 +150,7 @@
 
     # OpenStack API
     iniset $HEAT_CONF heat_api bind_port $HEAT_API_PORT
+    iniset $HEAT_CONF heat_api workers "$API_WORKERS"
 
     # Cloudformation API
     iniset $HEAT_CONF heat_api_cfn bind_port $HEAT_API_CFN_PORT
diff --git a/lib/neutron_plugins/ovs_base b/lib/neutron_plugins/ovs_base
index cde5298..2997c6c 100644
--- a/lib/neutron_plugins/ovs_base
+++ b/lib/neutron_plugins/ovs_base
@@ -28,7 +28,7 @@
 
 function neutron_ovs_base_cleanup {
     # remove all OVS ports that look like Neutron created ports
-    for port in $(sudo ovs-vsctl list port | grep -o -e tap[0-9a-f\-]* -e q[rg]-[0-9a-f\-]*); do
+    for port in $(sudo ovs-vsctl list port | grep -o -e [a-zA-Z\-]*tap[0-9a-f\-]* -e q[rg]-[0-9a-f\-]*); do
         sudo ovs-vsctl del-port ${port}
     done
 
diff --git a/lib/rpc_backend b/lib/rpc_backend
index d87d620..981b80b 100644
--- a/lib/rpc_backend
+++ b/lib/rpc_backend
@@ -243,7 +243,7 @@
     if is_service_enabled zeromq; then
         iniset $file $section rpc_backend "zmq"
         iniset $file $section rpc_zmq_matchmaker \
-            oslo.messaging._drivers.matchmaker_redis.MatchMakerRedis
+            oslo_messaging._drivers.matchmaker_redis.MatchMakerRedis
         # Set MATCHMAKER_REDIS_HOST if running multi-node.
         MATCHMAKER_REDIS_HOST=${MATCHMAKER_REDIS_HOST:-127.0.0.1}
         iniset $file matchmaker_redis host $MATCHMAKER_REDIS_HOST
@@ -252,7 +252,7 @@
         if [ "$RPC_MESSAGING_PROTOCOL" == "AMQP1" ]; then
             iniset $file $section rpc_backend "amqp"
         else
-            iniset $file $section rpc_backend ${package}.openstack.common.rpc.impl_qpid
+            iniset $file $section rpc_backend "qpid"
         fi
         iniset $file $section qpid_hostname ${QPID_HOST:-$SERVICE_HOST}
         if [ -n "$QPID_USERNAME" ]; then
@@ -260,7 +260,7 @@
             iniset $file $section qpid_password $QPID_PASSWORD
         fi
     elif is_service_enabled rabbit || { [ -n "$RABBIT_HOST" ] && [ -n "$RABBIT_PASSWORD" ]; }; then
-        iniset $file $section rpc_backend ${package}.openstack.common.rpc.impl_kombu
+        iniset $file $section rpc_backend "rabbit"
         iniset $file $section rabbit_hosts $RABBIT_HOST
         iniset $file $section rabbit_password $RABBIT_PASSWORD
         iniset $file $section rabbit_userid $RABBIT_USERID
diff --git a/lib/swift b/lib/swift
index ee4543c..e6e1212 100644
--- a/lib/swift
+++ b/lib/swift
@@ -409,16 +409,27 @@
     # Configure Crossdomain
     iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:crossdomain use "egg:swift#crossdomain"
 
-    # Configure Keystone
-    sed -i '/^# \[filter:authtoken\]/,/^# \[filter:keystoneauth\]$/ s/^#[ \t]*//' ${SWIFT_CONFIG_PROXY_SERVER}
-    configure_auth_token_middleware ${SWIFT_CONFIG_PROXY_SERVER} swift $SWIFT_AUTH_CACHE_DIR filter:authtoken
+
     # This causes the authtoken middleware to use the same python logging
     # adapter provided by the swift proxy-server, so that request transaction
     # IDs will included in all of its log messages.
     iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken log_name swift
 
-    iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} filter:keystoneauth use
-    iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} filter:keystoneauth operator_roles
+    # NOTE(jamielennox): swift cannot use the regular configure_auth_token_middleware function because swift
+    # doesn't use oslo.config which is the only way to configure auth plugins with the middleare.
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken paste.filter_factory keystonemiddleware.auth_token:filter_factory
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken identity_uri $KEYSTONE_AUTH_URI
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken admin_user swift
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken admin_password $SERVICE_PASSWORD
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken admin_tenant_name $SERVICE_TENANT_NAME
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken auth_uri $KEYSTONE_SERVICE_URI
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken cafile $SSL_BUNDLE_FILE
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken signing_dir $SWIFT_AUTH_CACHE_DIR
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken delay_auth_decision 1
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken cache swift.cache
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:authtoken include_service_catalog False
+
+    iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:keystoneauth use "egg:swift#keystoneauth"
     iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:keystoneauth operator_roles "Member, admin"
 
     # Configure Tempauth. In the sample config file, Keystoneauth is commented
diff --git a/stack.sh b/stack.sh
index cda302f..eaecea0 100755
--- a/stack.sh
+++ b/stack.sh
@@ -13,11 +13,11 @@
 # a multi-node developer install.
 
 # To keep this script simple we assume you are running on a recent **Ubuntu**
-# (12.04 Precise or newer) or **Fedora** (F18 or newer) machine.  (It may work
-# on other platforms but support for those platforms is left to those who added
-# them to DevStack.)  It should work in a VM or physical server.  Additionally
-# we maintain a list of ``apt`` and ``rpm`` dependencies and other configuration
-# files in this repo.
+# (14.04 Trusty or newer), **Fedora** (F20 or newer), or **CentOS/RHEL**
+# (7 or newer) machine. (It may work on other platforms but support for those
+# platforms is left to those who added them to DevStack.) It should work in
+# a VM or physical server. Additionally, we maintain a list of ``apt`` and
+# ``rpm`` dependencies and other configuration files in this repo.
 
 # Learn more and get the most recent version at http://devstack.org
 
diff --git a/stackrc b/stackrc
index ff82140..99748ce 100644
--- a/stackrc
+++ b/stackrc
@@ -32,15 +32,11 @@
 # ``disable_service`` functions in ``local.conf``.
 # For example, to enable Swift add this to ``local.conf``:
 #  enable_service s-proxy s-object s-container s-account
-# In order to enable Neutron (a single node setup) add the following
-# settings in ``local.conf``:
+# In order to enable nova-networking add the following settings in
+# `` local.conf ``:
 #  [[local|localrc]]
-#  disable_service n-net
-#  enable_service q-svc
-#  enable_service q-agt
-#  enable_service q-dhcp
-#  enable_service q-l3
-#  enable_service q-meta
+#  disable_service q-svc q-agt q-dhcp q-l3 q-meta
+#  enable_service n-net
 #  # Optional, to enable tempest configuration as part of devstack
 #  enable_service tempest
 function isset {
@@ -54,14 +50,16 @@
 
 # this allows us to pass ENABLED_SERVICES
 if ! isset ENABLED_SERVICES ; then
-    # core compute (glance / keystone / nova (+ nova-network))
-    ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,n-sch,n-xvnc,n-cauth
+    # core compute (glance / keystone / nova)
+    ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-cond,n-sch,n-xvnc,n-cauth
     # cinder
     ENABLED_SERVICES+=,c-sch,c-api,c-vol
     # heat
     ENABLED_SERVICES+=,h-eng,h-api,h-api-cfn,h-api-cw
     # dashboard
     ENABLED_SERVICES+=,horizon
+    # neutron
+    ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta
     # additional services
     ENABLED_SERVICES+=,rabbit,tempest,mysql
 fi
diff --git a/tools/xen/build_xva.sh b/tools/xen/build_xva.sh
index 7002e6e..25bf58c 100755
--- a/tools/xen/build_xva.sh
+++ b/tools/xen/build_xva.sh
@@ -104,7 +104,7 @@
 task
 
 pre-start script
-    rm -f /var/run/devstack.succeeded
+    rm -f /opt/stack/runsh.succeeded
 end script
 
 script
@@ -127,7 +127,7 @@
         IPADDR=\$(ip -4 address show eth0 | sed -n 's/.*inet \\([0-9\.]\\+\\).*/\1/p')
         echo "  Management IP:   \$IPADDR"
         echo -n "  Devstack run:    "
-        if [ -e /var/run/devstack.succeeded ]; then
+        if [ -e /opt/stack/runsh.succeeded ]; then
             echo "SUCCEEDED"
         else
             echo "FAILED"