xenapi: Use a jeos vm as a template

DevStack was using templating to speed up the setup process with
XenServer. The template already included some devstack customisations,
not just a clean OS. This change modifies devstack behaviour, so that
the template is a simple clean operating system. This makes it easier to
use custom OS as a template, potentially speeding up the tests.

related to blueprint xenapi-devstack-cleanup

Change-Id: I6cb0a7ed7a90e749b78329a8e2b65fb8b7fcfa5f
Remove unused keystone params from neutron agents' config files

DHCP, L3 and Metadata agents' config files no longer need to
duplicate this info; it's available in neutron.conf

Change-Id: I7bea25d1c2b9249ddacce3f4638f7a8ed4f43197
Add call trace in error message

Call trace can help user to locate problem quickly.

stack.sh uses bash as interpreter, which defines a series of
"Shell Variables":
BASH_SOURCE:
An array variable whose members are the source filenames

BASH_LINENO:
An array variable whose members are the line numbers in source
files where each corresponding member of FUNCNAME  was  invoked.

FUNCNAME:
An array variable containing the names of all shell functions
currently in the execution call stack.

run "man bash" and search the variable name to get detailed info.

In function backtrace, it gets the call deepth from
${#BASH_SOURCE[@]}, then print the call stack from top to down.

In function die, backtrace is called with parameter "2" to ignore
the call trace of function "die" and "backtrace".

I add a broken function in lib/database, and call it in stack.sh,
the output looks like this:

[Call Trace]
./stack.sh:104:broken
/home/kui/osd/devstack/lib/database:24:die
[ERROR] ./stack.sh:24 It is broken

Fixes bug # 1207660

Change-Id: I04d0b3ccf783c769e41582c20f48694c19917334
misleading source filename in error message

when ./stack.sh encounters error, the output may look like this:
[ERROR] ./stack.sh:698 nova-api did not start

The source filename is wrong. Actually, it should be like this:
[ERROR] /<path_of_devstack>/lib/nova:698 nova-api did not start

stack.sh uses bash as interpreter, which define "Shell Variables"
BASH_SOURCE:
    An array variable whose members are the source filenames where
    the corresponding shell function names  in  the  FUNCNAME  array
    variable  are  defined.   The  shell  function
    ${FUNCNAME[$i]}  is  defined  in  the  file ${BASH_SOURCE[$i]}
    and called from ${BASH_SOURCE[$i+1]}.

The function "err" is called by function "die" ( and "err_if_not_set",
and "err_if_not_set" is not used at all). ${BASH_SOURCE[2]} will
ignore the deepest two call entries, which corresponding to the shell
functions: "err" and "die".

In one sentence, this change will print the source filename where the
function is defined and exits via function "die".

Fixes bug #1207658

Change-Id: I2aa6642c5cf4cfe781afe278b3dec3e7cba277fa
Default to xenserver driver if xenserver-core is installed

Fixes bug 1209205

Change-Id: I63085cc87610a59fc48e519e4351c9233b3961be
Support heat in standalone mode.

The following localrc will launch only heat in standalone mode
and allow it to provision within the openstack specified by
the configured keystone endpoint:
HEAT_STANDALONE=True
ENABLED_SERVICES=rabbit,mysql,heat,h-api,h-api-cfn,h-api-cw,h-eng
KEYSTONE_SERVICE_HOST=...
KEYSTONE_AUTH_HOST=...

Change-Id: I0d8a541fc9d592577423b074c789829f8b8d6702
Add tools/install_pip.sh

Install a known working recent version of pip that handles installation
dependencies more correctly than before.  Extract to a separate script
so it can be used apart from stack.sh.

* Install distro setuptools if it not already present
* Install pip from source tarball as get-pip.py proved to be unreliable
* Remove python-distribute and python-pip from all prereq files,
  move python-setuptools to 'general'
* Remove the earlier unfubar_setuptppls() call that attenpted to fix this
* Only update requirements.txt when no changes in repo

Tested on Precise, F18 and CentOS6.
* Fedora and RHEL allow pip to install packages ON TOP OF RPM-installed
  packages.  THIS IS BROKEN.  And is one reason we have to be so picky
  about order and so forth.

Change-Id: Ibb4b42119dc2e51577c77bbbbffb110863e5324d
Merge "Add call trace in error message"
Merge "Add tools/install_pip.sh"
Merge "misleading source filename in error message"
Add Cinder V2 API to keystone catalog

Support both SQL and templated keystone backend. This will add an
additional endpoint to go with v1.

Change-Id: I19168d55c2ffad2b1cd668b6c1341dc8e49e9c1f
Cinder configuration is not set up for Ceilometer

enable cinder notifications when ceilometer is enabled

Change-Id: I55809f1cef35aca90f8513a73df1417dcf08098d
Fixes:Bug1210269
Enable debug logging on tempest

With tempest moving to testr (serially currently) the log level is no
longer defaulting to debug as it did with nose. To get the same level
of verbosity in the logging as when running with nose this commit
sets the debug flag on tempest.

Change-Id: I6acd57be0f8188d31825d88471ba9883ebb30519
cleanup potentially installed older oslo.config

If the user had oslo.config installed prior to us setting up the
oslo.config out of git they can get themselves into this very funny
situation where pip doesn't see oslo.config 1.1.x, however some
packages might. This manifests itself as a user error trying to
start nova-api which uses DeprecatedOption, not in oslo.config 1.1.x

Because of the funny state pip is in, you can't uninstall oslo.config.

So in these situations, if we see old oslo.config in the filesystem,
pip install / uninstall it to ensure that everyone ends up using the
git version instead.

To reduce the amount of user confusion, do this on every
install_oslo for a while, which we can purge after Havana ships.

Change-Id: If92073be5a431840701c952a194e63a7c452c9ca
Merge "Remove unused keystone params from neutron agents' config files"
Merge "cleanup potentially installed older oslo.config"
Merge "Default to xenserver driver if xenserver-core is installed"
Merge "Support heat in standalone mode."
Force $DEST to have wider permissions

This is particularly useful in the case where we create the
home directory above and the permissions are too strict.

Other users, such as the apache user, need read/execute for this
directory.

Change-Id: I908d993dbcd863b482030afcc04e5e7b9f4cffa1
Add some missing pkgs to Cinder install

Added python-dev even though it's picked up
by other projects already, just to be explicit.

Also added libpq-dev, this way users can just
run "sudo pip install -r test-requirements.txt"
and perform everything in run_tests.sh without the
need for venv.

Change-Id: I3953032ac40ef78fc6f67d77539e13539fbbb2ac