Merge "Improve savanna-dashboard installation"
diff --git a/lib/heat b/lib/heat
index 9f5dd8b..efb01ef 100644
--- a/lib/heat
+++ b/lib/heat
@@ -110,6 +110,15 @@
     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
 
@@ -196,6 +205,17 @@
     upload_image "http://localhost/$output.qcow2" $TOKEN
 }
 
+# create_heat_accounts() - Set up common required heat accounts
+# Note this is in addition to what is in files/keystone_data.sh
+function create_heat_accounts() {
+    # 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 \
+        --os-identity-api-version=3 domain create heat \
+        --description "Owns users and projects created by heat"
+}
+
 # Restore xtrace
 $XTRACE
 
diff --git a/lib/marconi b/lib/marconi
index 88312cb..b6ce57a 100644
--- a/lib/marconi
+++ b/lib/marconi
@@ -68,7 +68,9 @@
 # cleanup_marconi() - Remove residual data files, anything left over from previous
 # runs that a clean run would need to clean up
 function cleanup_marconi() {
-    mongo marconi --eval "db.dropDatabase();"
+    if ! timeout $SERVICE_TIMEOUT sh -c "while ! mongo marconi --eval 'db.dropDatabase();'; do sleep 1; done"; then
+        die $LINENO "Mongo DB did not start"
+    fi
 }
 
 # configure_marconiclient() - Set config files, create data dirs, etc
diff --git a/lib/neutron_plugins/ml2 b/lib/neutron_plugins/ml2
index ab4e347..4ceabe7 100644
--- a/lib/neutron_plugins/ml2
+++ b/lib/neutron_plugins/ml2
@@ -93,9 +93,9 @@
     # instead use its own config variable to indicate whether security
     # groups is enabled, and that will need to be set here instead.
     if [[ "$Q_USE_SECGROUP" == "True" ]]; then
-        iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver neutron.agent.not.a.real.FirewallDriver
+        iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.not.a.real.FirewallDriver
     else
-        iniset /$Q_PLUGIN_CONF_FILE SECURITYGROUP firewall_driver neutron.agent.firewall.NoopFirewallDriver
+        iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
     fi
 
     # Since we enable the tunnel TypeDrivers, also enable a local_ip
diff --git a/lib/oslo b/lib/oslo
index f644ed7..b089842 100644
--- a/lib/oslo
+++ b/lib/oslo
@@ -20,9 +20,13 @@
 
 # Defaults
 # --------
+CLIFF_DIR=$DEST/cliff
 OSLOCFG_DIR=$DEST/oslo.config
 OSLOMSG_DIR=$DEST/oslo.messaging
 OSLORWRAP_DIR=$DEST/oslo.rootwrap
+PYCADF_DIR=$DEST/pycadf
+STEVEDORE_DIR=$DEST/stevedore
+TASKFLOW_DIR=$DEST/taskflow
 
 # Entry Points
 # ------------
@@ -33,6 +37,9 @@
     # for a smoother transition of existing users.
     cleanup_oslo
 
+    git_clone $CLIFF_REPO $CLIFF_DIR $CLIFF_BRANCH
+    setup_develop $CLIFF_DIR
+
     git_clone $OSLOCFG_REPO $OSLOCFG_DIR $OSLOCFG_BRANCH
     setup_develop $OSLOCFG_DIR
 
@@ -41,6 +48,15 @@
 
     git_clone $OSLORWRAP_REPO $OSLORWRAP_DIR $OSLORWRAP_BRANCH
     setup_develop $OSLORWRAP_DIR
+
+    git_clone $PYCADF_REPO $PYCADF_DIR $PYCADF_BRANCH
+    setup_develop $PYCADF_DIR
+
+    git_clone $STEVEDORE_REPO $STEVEDORE_DIR $STEVEDORE_BRANCH
+    setup_develop $STEVEDORE_DIR
+
+    git_clone $TASKFLOW_REPO $TASKFLOW_DIR $TASKFLOW_BRANCH
+    setup_develop $TASKFLOW_DIR
 }
 
 # cleanup_oslo() - purge possibly old versions of oslo
diff --git a/lib/trove b/lib/trove
index 5e1bbd5..6834149 100644
--- a/lib/trove
+++ b/lib/trove
@@ -86,7 +86,7 @@
             --project $SERVICE_TENANT \
             --user $TROVE_USER
         if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
-            TROVE_SERVICE=$(openstack service create
+            TROVE_SERVICE=$(openstack service create \
                 trove \
                 --type=database \
                 --description="Trove Service" \
diff --git a/openrc b/openrc
index 784b00e..fc066ad 100644
--- a/openrc
+++ b/openrc
@@ -67,7 +67,7 @@
 # Identity API version
 export OS_IDENTITY_API_VERSION=${IDENTITY_API_VERSION:-2.0}
 
-# Authenticating against an Openstack cloud using Keystone returns a **Token**
+# Authenticating against an OpenStack cloud using Keystone returns a **Token**
 # and **Service Catalog**.  The catalog contains the endpoints for all services
 # the user/tenant has access to - including nova, glance, keystone, swift, ...
 # We currently recommend using the 2.0 *identity api*.
diff --git a/stack.sh b/stack.sh
index e5d87cc..4a55225 100755
--- a/stack.sh
+++ b/stack.sh
@@ -941,6 +941,10 @@
         create_swift_accounts
     fi
 
+    if is_service_enabled heat; then
+        create_heat_accounts
+    fi
+
     # ``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 \
     SERVICE_TOKEN=$SERVICE_TOKEN SERVICE_ENDPOINT=$SERVICE_ENDPOINT SERVICE_HOST=$SERVICE_HOST \
diff --git a/stackrc b/stackrc
index 52105e6..56fa402 100644
--- a/stackrc
+++ b/stackrc
@@ -140,6 +140,10 @@
 OPENSTACKCLIENT_REPO=${OPENSTACKCLIENT_REPO:-${GIT_BASE}/openstack/python-openstackclient.git}
 OPENSTACKCLIENT_BRANCH=${OPENSTACKCLIENT_BRANCH:-master}
 
+# cliff command line framework
+CLIFF_REPO=${CLIFF_REPO:-${GIT_BASE}/openstack/cliff.git}
+CLIFF_BRANCH=${CLIFF_BRANCH:-master}
+
 # oslo.config
 OSLOCFG_REPO=${OSLOCFG_REPO:-${GIT_BASE}/openstack/oslo.config.git}
 OSLOCFG_BRANCH=${OSLOCFG_BRANCH:-master}
@@ -152,6 +156,18 @@
 OSLORWRAP_REPO=${OSLORWRAP_REPO:-${GIT_BASE}/openstack/oslo.rootwrap.git}
 OSLORWRAP_BRANCH=${OSLORWRAP_BRANCH:-master}
 
+# pycadf auditing library
+PYCADF_REPO=${PYCADF_REPO:-${GIT_BASE}/openstack/pycadf.git}
+PYCADF_BRANCH=${PYCADF_BRANCH:-master}
+
+# stevedore plugin manager
+STEVEDORE_REPO=${STEVEDORE_REPO:-${GIT_BASE}/openstack/stevedore.git}
+STEVEDORE_BRANCH=${STEVEDORE_BRANCH:-master}
+
+# taskflow plugin manager
+TASKFLOW_REPO=${TASKFLOW_REPO:-${GIT_BASE}/openstack/taskflow.git}
+TASKFLOW_BRANCH=${TASKFLOW_BRANCH:-master}
+
 # pbr drives the setuptools configs
 PBR_REPO=${PBR_REPO:-${GIT_BASE}/openstack-dev/pbr.git}
 PBR_BRANCH=${PBR_BRANCH:-master}
diff --git a/tools/create_userrc.sh b/tools/create_userrc.sh
index d9c93cc..a2d0c52 100755
--- a/tools/create_userrc.sh
+++ b/tools/create_userrc.sh
@@ -199,7 +199,7 @@
 export S3_URL="$S3_URL"
 # OpenStack USER ID = $user_id
 export OS_USERNAME="$user_name"
-# Openstack Tenant ID = $tenant_id
+# OpenStack Tenant ID = $tenant_id
 export OS_TENANT_NAME="$tenant_name"
 export OS_AUTH_URL="$OS_AUTH_URL"
 export OS_CACERT="$OS_CACERT"
diff --git a/tools/jenkins/README.md b/tools/jenkins/README.md
index 371017d..3586da9 100644
--- a/tools/jenkins/README.md
+++ b/tools/jenkins/README.md
@@ -1,6 +1,6 @@
 Getting Started With Jenkins and Devstack
 =========================================
-This little corner of devstack is to show how to get an Openstack jenkins
+This little corner of devstack is to show how to get an OpenStack jenkins
 environment up and running quickly, using the rcb configuration methodology.
 
 
diff --git a/tools/xen/README.md b/tools/xen/README.md
index ee1abcc..712782b 100644
--- a/tools/xen/README.md
+++ b/tools/xen/README.md
@@ -1,11 +1,11 @@
 # Getting Started With XenServer and Devstack
 
 The purpose of the code in this directory it to help developers bootstrap a
-XenServer 6.2 (older versions may also work) + Openstack development
+XenServer 6.2 (older versions may also work) + OpenStack development
 environment. This file gives some pointers on how to get started.
 
 Xenserver is a Type 1 hypervisor, so it is best installed on bare metal.  The
-Openstack services are configured to run within a virtual machine (called OS
+OpenStack services are configured to run within a virtual machine (called OS
 domU) on the XenServer host. The VM uses the XAPI toolstack to communicate with
 the host over a network connection (see `MGT_BRIDGE_OR_NET_NAME`).