Update sqlite to use PoolEvents for regexp.

Use PoolEvents instead of PoolListener for adding regexp function.

Fixes bug 1037219

Change-Id: I205ecce133f628e995f38dea5ce89ddf36b01a9b
Adds support for serial to libvirt config disks.

In order for users to find a volume that they have attached to
a vm, it is valuable to be able to find it in a consistent
location. A following patch wil accomplish this by setting
the serial number of the device to the uuid of the volume.

This patch prepares for that change by allowing serial numbers
to be set in the libvirt config disk object.

Prepares to fix bug 1004328

Change-Id: Iecdfc17b45e1c38df50f844f127c0e95558ab22c
xenapi: Tag nova volumes during attach_volume

1. Set other_config:'osvol':'True' on VBD during attach.
2. Use this (instead of nodestroys list) to determine which volumes
should not be destroyed on instance terminate.
3. Ensure that the SRs for the attached volumes are forgotten when
instance is terminated.

In the virt/xenapi layer, there is no way to determine which of the
VDIs are nova volumes. This information is required when terminating
and instance, to ensure the volumes are kept intact, as well as other
operations like migrate.

Fixes bug 1030143.

Change-Id: Id1717e64bc29092ce9ffe13b7c254a3867fe8342
Code clean up

Some code clean up in the file doc/source/conf.py
to make the code more pretty.

Change-Id: Icb25428739725c530977a011bf28f17fda1c29fb
add availability_zone to openstack metadata

This adds the key 'availability_zone' to the metadata for openstack.

'availability-zone' in EC2 is very useful to the instance to figure out
where it is.  For example, Ubuntu uses this information to determine
mirror location on EC2.

Fixes bug 1039579.

Change-Id: I212d3854b75e08a67138b5cd0bea178c47840e11
Restore imagebackend in test_virt_drivers.py

In the test, nova.virt.libvirt.driver.imagebackend is replaced with
fake_imagebackend at setUp(). But is not restored at tearDown(). It
potentially causes failure in other tests expecting imagebackend is
unchanged. Example: test_libvirt.py:test_pre_block_migration_works_correctly.
However it runs without failure since luckily it comes before
test_virt_drivers.py.

Change-Id: I9b61c6c065567472b64bfa363af8f3ba9a502dd2
Adds missing assertion to FloatingIP tests

Adding assertions to some tests to ensure that we catch the
return status_int. Found that test_floating_ip_disassociate would
actually fail the test if status_int was caught. Adding the
get_instance_by_floating_ip_addr stub to to the disassociate test
to return the test instance on IP match. This is required because
get_instance_by_floating_ip_addr is stubbed in setup to return None.
Fixes bug 1039432.

Also making a minor change in test_bad_param_in_remove_floating_ip
which should call _remove_floating_ip rather than _add_floating_ip.

Change-Id: Id43f785bb0e6b7405e2d292292c4126d7ed656cb
Remove unused _create_network_filters()

Commit b4fae4821f removed unused code which, in turn, made
_create_network_filters() unused.

Change-Id: I6e1e3aa1c1c977c5ab06d51aef1b43a06d1081b8
Clarify nwfilter not found error message

In bug #1039398 the user got an error message about an instance's
nwfilter not being found, but it gave the impression that live
migration was involved.

The ensure_filtering_rules_for_instance() method was originally
just used for live migration, but since:

  https://code.launchpad.net/~chemikadze/nova/driver-agnostic-restart-instances/+merge/69069

it has also been used when re-starting the compute service when
there are running VMs.

Clarify the error message and the comments in the code to reflect
this.

Waiting up to 30 seconds before reporting an error here seems
pretty bad. It appears this is to handle the case where the
nwfilters get defined in a separate thread. For reference, the
code was added by this merge:

  https://code.launchpad.net/~nttdata/nova/live-migration/+merge/44940

For now, just add a comment explaining why we're polling for
the existence of the nwfilter.

Change-Id: Ieb085a6753ac72116d5f5a706fd1a908703286ad
Don't show user-data when its not sent.

Don't show user-data in the instance metadata service
if the instance was not started with any user-data.

LP: #1035317

Change-Id: Idf9b263a39f3b8d75aaf3e6d1debbe283cf9ff64
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Fix hacking.py git checks to propagate errors

Now when N801 or N802 is hit tools/hacking.py will return -1.

Fix bug 1039697

Change-Id: I9f6950a4396ae82861e5de0e4f3ba8b482c4fdf8
Typo fix: existant => existent

Impact:
* debug log message in nova/compute/manager
* Test function names
* Test strings and comments

Change-Id: I9be1b0ced2dfe257eef9785659f2cbe27b07ad3f
Merge "Code clean up"
Fix hyperv Cfgs: StrOpt to IntOpt

Change hyperv_attaching_volume_retry_count and hyperv_wait_between_attach_retry
from StrOpt to IntOpt

Fix bug 1040246

Change-Id: I8a70212cbc6852bdab4190ac8eb314d10e1a1ed5
Merge "Fix hacking.py git checks to propagate errors"
Merge "xenapi: Tag nova volumes during attach_volume"
Merge "Don't show user-data when its not sent."
Merge "Restore imagebackend in test_virt_drivers.py"
Merge "Clarify nwfilter not found error message"
Merge "Remove unused _create_network_filters()"