Merge "local call masks errors in subshells"
diff --git a/doc/source/guides/devstack-with-nested-kvm.rst b/doc/source/guides/devstack-with-nested-kvm.rst
index b35492e..c652bac 100644
--- a/doc/source/guides/devstack-with-nested-kvm.rst
+++ b/doc/source/guides/devstack-with-nested-kvm.rst
@@ -88,7 +88,7 @@
     parm:           nested:int
 
 To make the above value persistent across reboots, add an entry in
-/etc/modprobe.ddist.conf so it looks as below::
+/etc/modprobe.d/dist.conf so it looks as below::
 
     cat /etc/modprobe.d/dist.conf
     options kvm-amd nested=y
diff --git a/doc/source/plugins.rst b/doc/source/plugins.rst
index b166936..1b6f5e3 100644
--- a/doc/source/plugins.rst
+++ b/doc/source/plugins.rst
@@ -221,7 +221,9 @@
 ``stackforge/devstack-plugin-FOO`` project.
 
 To enable a plugin to be used in a gate job, the following lines will
-be needed in your project.yaml definition::
+be needed in your ``jenkins/jobs/<project>.yaml`` definition in
+`project-config
+<http://git.openstack.org/cgit/openstack-infra/project-config/>`_::
 
   # Because we are testing a non standard project, add the
   # our project repository. This makes zuul do the right
diff --git a/functions-common b/functions-common
index a2a9a3d..60cf04c 100644
--- a/functions-common
+++ b/functions-common
@@ -270,8 +270,9 @@
         # Fedora release 16 (Verne)
         # XenServer release 6.2.0-70446c (xenenterprise)
         # Oracle Linux release 7
+        # CloudLinux release 7.1
         os_CODENAME=""
-        for r in "Red Hat" CentOS Fedora XenServer; do
+        for r in "Red Hat" CentOS Fedora XenServer CloudLinux; do
             os_VENDOR=$r
             if [[ -n "`grep \"$r\" /etc/redhat-release`" ]]; then
                 ver=`sed -e 's/^.* \([0-9].*\) (\(.*\)).*$/\1\|\2/' /etc/redhat-release`
@@ -375,7 +376,8 @@
     fi
 
     [ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \
-        [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleLinux" ]
+        [ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "OracleLinux" ] || \
+        [ "$os_VENDOR" = "CloudLinux" ]
 }
 
 
diff --git a/lib/ceilometer b/lib/ceilometer
index 7905384..9226d85 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -211,6 +211,7 @@
     cp $CEILOMETER_DIR/etc/ceilometer/event_pipeline.yaml $CEILOMETER_CONF_DIR
     cp $CEILOMETER_DIR/etc/ceilometer/api_paste.ini $CEILOMETER_CONF_DIR
     cp $CEILOMETER_DIR/etc/ceilometer/event_definitions.yaml $CEILOMETER_CONF_DIR
+    cp $CEILOMETER_DIR/etc/ceilometer/meters.yaml $CEILOMETER_CONF_DIR
 
     if [ "$CEILOMETER_PIPELINE_INTERVAL" ]; then
         sed -i "s/interval:.*/interval: ${CEILOMETER_PIPELINE_INTERVAL}/" $CEILOMETER_CONF_DIR/pipeline.yaml
diff --git a/lib/cinder b/lib/cinder
index a9a9f0d..e5ed2db 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -485,7 +485,9 @@
         local be be_name
         for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
             be_name=${be##*:}
-            openstack volume type create --property volume_backend_name="${be_name}" ${be_name}
+            # FIXME(jamielennox): Remove --os-volume-api-version pinning when
+            # osc supports volume type create on v2 api. bug #1475060
+            openstack volume type create --os-volume-api-version 1 --property volume_backend_name="${be_name}" ${be_name}
         done
     fi
 }
diff --git a/lib/databases/mysql b/lib/databases/mysql
index 9c9401e..fb55b60 100644
--- a/lib/databases/mysql
+++ b/lib/databases/mysql
@@ -95,9 +95,9 @@
     sudo bash -c "source $TOP_DIR/functions && \
         iniset $my_conf mysqld bind-address "$SERVICE_LISTEN_ADDRESS" && \
         iniset $my_conf mysqld sql_mode STRICT_ALL_TABLES && \
-        iniset $my_conf mysqld default-storage-engine InnoDB \
-        iniset $my_conf mysqld max_connections 1024 \
-        iniset $my_conf mysqld query_cache_type OFF \
+        iniset $my_conf mysqld default-storage-engine InnoDB && \
+        iniset $my_conf mysqld max_connections 1024 && \
+        iniset $my_conf mysqld query_cache_type OFF && \
         iniset $my_conf mysqld query_cache_size 0"
 
 
diff --git a/lib/keystone b/lib/keystone
index 428e615..59584b2 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -313,6 +313,8 @@
 
     iniset $KEYSTONE_CONF eventlet_server admin_workers "$API_WORKERS"
     # Public workers will use the server default, typically number of CPU.
+
+    iniset $KEYSTONE_CONF fernet_tokens key_repository "$KEYSTONE_CONF_DIR/fernet-keys/"
 }
 
 function configure_keystone_extensions {
@@ -475,11 +477,15 @@
         $KEYSTONE_BIN_DIR/keystone-manage db_sync --extension "${extension_value}"
     done
 
-    if [[ "$KEYSTONE_TOKEN_FORMAT" != "uuid" ]]; then
+    if [[ "$KEYSTONE_TOKEN_FORMAT" == "pki" || "$KEYSTONE_TOKEN_FORMAT" == "pkiz" ]]; then
         # Set up certificates
         rm -rf $KEYSTONE_CONF_DIR/ssl
         $KEYSTONE_BIN_DIR/keystone-manage pki_setup
     fi
+    if [[ "$KEYSTONE_TOKEN_FORMAT" == "fernet" ]]; then
+        rm -rf "$KEYSTONE_CONF_DIR/fernet-keys/"
+        $KEYSTONE_BIN_DIR/keystone-manage fernet_setup
+    fi
 }
 
 # install_keystoneclient() - Collect source and prepare
diff --git a/lib/nova_plugins/hypervisor-libvirt b/lib/nova_plugins/hypervisor-libvirt
index f52629d..c54a716 100644
--- a/lib/nova_plugins/hypervisor-libvirt
+++ b/lib/nova_plugins/hypervisor-libvirt
@@ -64,6 +64,10 @@
     if [[ "$LIBVIRT_TYPE" = "parallels" ]]; then
         iniset $NOVA_CONF libvirt connection_uri "parallels+unix:///system"
         iniset $NOVA_CONF libvirt images_type "ploop"
+        iniset $NOVA_CONF DEFAULT force_raw_images  "False"
+        iniset $NOVA_CONF DEFAULT vncserver_proxyclient_address  $HOST_IP
+        iniset $NOVA_CONF DEFAULT vncserver_listen $HOST_IP
+        iniset $NOVA_CONF DEFAULT vnc_keymap
     fi
 }
 
diff --git a/tests/test_worlddump.sh b/tests/test_worlddump.sh
new file mode 100755
index 0000000..f407d40
--- /dev/null
+++ b/tests/test_worlddump.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Simple test of worlddump.py
+
+TOP=$(cd $(dirname "$0")/.. && pwd)
+
+source $TOP/tests/unittest.sh
+
+OUT_DIR=$(mktemp -d)
+
+$TOP/tools/worlddump.py -d $OUT_DIR
+
+if [[ $? -ne 0 ]]; then
+    fail "worlddump failed"
+else
+
+    # worlddump creates just one output file
+    OUT_FILE=($OUT_DIR/*.txt)
+
+    if [ ! -r $OUT_FILE ]; then
+        failed "worlddump output not seen"
+    else
+        passed "worlddump output $OUT_FILE"
+
+        if [[ $(stat -c %s $OUT_DIR/*.txt) -gt 0 ]]; then
+            passed "worlddump output is not zero sized"
+        fi
+
+        # put more extensive examination here, if required.
+    fi
+fi
+
+rm -rf $OUT_DIR
+
+report_results
diff --git a/tools/worlddump.py b/tools/worlddump.py
index 628a69f..e4ba02b 100755
--- a/tools/worlddump.py
+++ b/tools/worlddump.py
@@ -21,9 +21,9 @@
 import fnmatch
 import os
 import os.path
+import subprocess
 import sys
 
-from subprocess import Popen
 
 def get_options():
     parser = argparse.ArgumentParser(
@@ -47,7 +47,10 @@
     print cmd
     print "-" * len(cmd)
     print
-    Popen(cmd, shell=True)
+    try:
+        subprocess.check_call(cmd, shell=True)
+    except subprocess.CalledProcessError:
+        print "*** Failed to run: %s" % cmd
 
 
 def _header(name):
@@ -109,6 +112,13 @@
 
 def guru_meditation_report():
     _header("nova-compute Guru Meditation Report")
+
+    try:
+        subprocess.check_call(["pgrep","nova-compute"])
+    except subprocess.CalledProcessError:
+        print "Skipping as nova-compute does not appear to be running"
+        return
+
     _dump_cmd("kill -s USR1 `pgrep nova-compute`")
     print "guru meditation report in nova-compute log"