ensure atomic manipulation of libvirt disk images

This pattern could probably be used elsewhere,
but only libvirt disk images are considered for now.
This change ensures there are no stale files left
anywhere in the path from glance, through the libvirt image cache.
These could cause subsequent operational errors either
directly or indirectly through disk wastage.

* nova/utils.py: Add a new remove_path_on_error() context manager
that is used to remove the passed PATH on a raised exception.
* nova/virt/images.py: Ensure temporary downloaded and
converted images are protected.
* nova/virt/libvirt/connection.py: Ensure all the images in
the image cache and instance dirs are protected.

Change-Id: I81a5407665a6998128c0dee41387ef00ebddeb4d
Clean up read_deleted support in host aggregates code

tl;dr - this is a cleaner fix for bug #949038

It seems clear to me that all of the DB APIs should not explicitly pass
read_deleted='no' or read_deleted='yes' to model_query without good
reason.

We want to allow callers to specify read_deleted via the context and
that only works if we don't explicitly pass it to model_query().

If we don't explicitly specify it to model_query(), we use the value
from the context which defaults to 'no'.

Given all that, there is no need to support read_deleted to any of the
DB API calls because they should support specifying the flag via the
context. There should also be no need to pass read_deleted='no' because
that is the default.

Really, the only place there should be any mention of read_deleted is
where we want read_deleted='yes' behaviour e.g.

  - In tests, where we want to check the operational_state of an
    aggregate after it has been deleted

  - Where we want to support undeleting an aggregate or aggreate host

Change-Id: I916a8d189a33d7f30838cccb26531a024066ef96
Fix traceback when sending invalid data.

Running euca-terminate-instance with invalid data results
in a traceback and a hang. This fixes bug 965225

Change-Id: I0b547d527bca5fb86ff650188ac903066361d933
Allow self-referential groups to be created

 fixes bug 965674

Change-Id: I41db135f6437e1f1cb496528ae4d134c0d9cb744
Default scheduler to spread-first

 * Fixes bug 965732

Change-Id: I239b2b235905b30879974144263037eba6ed409f
Remove auth_uri, already have auth_host, auth_port

Remove to clarify config

From keystone docs:
`auth_uri``: (optional, defaults to `auth_protocol`://`auth_host`:`auth_port`)

Change-Id: I4349cd9545c571b37886ae38416c27b841e797f8
Update KillFilter to handle 'deleted' exe's.

Updates KillFilter so that it handles the case where the executable
linked to by /proc/PID/exe is updated or deleted.

Fixes LP Bug #967931.

Change-Id: I368a01383bf62b64b7579d573b8b84640dec03ae
Make kombu failures retry on IOError

Fixes bug 797770

Unfortunately if rabbit decides protocol negotiation is taking too long,
it will close the socket on us.  This ends up raising IOError with a
'socket closed' message.  This patch will catch IOError and re-try.

Change-Id: I9110c845b71118c0fad760d90e91c585e6db46ed
Check vif exists before releasing ip

 * adds test to make sure code doesn't raise
 * fixes bug 968457

Change-Id: I7110cb18a45fb955769247a9a0c5fb721ab3935a
Fix libvirt rescue.

Updates libvirt connection.py so that it chowns console.log
correctly when performing a rescue.

Fixes LP Bug #968587.

Change-Id: I38a97df92330a9f20f43e9e4598da3375c6a22dc
Merge "Default scheduler to spread-first"
Merge "Check vif exists before releasing ip"
Merge "Update KillFilter to handle 'deleted' exe's."
Merge "Allow self-referential groups to be created"
Check that volume has no snapshots before deletion

 * Raise a helpful error message if existing snapshots are detected
 * Fixes bug 968700
 * Fixes bug 968649

Change-Id: I470db6bd51a103249aae9bfcb2167f0a486732c2
Check that DescribeInstance works with deleted image

This test checks that even if the image is non-existant, DescribeInstances
returns correctly an answer and does not fails because of ImageNotFound".

This has been the case previously (essex-4), and its now fixed with other
another issue listed in bug #948286, but I wrote a test to be sure of that.

Change-Id: I34df7a3fbc492f4418b2751b2b8bc527a7bbe335
Signed-off-by: Julien Danjou <julien@danjou.info>
Export user id as password to keystone when using noauth

Fixes bug #969208

When using noauth, a user's password is her user id (e.g. in novarc).

When we export to keystone, we should make sure the same credentials
keep working rather than effectively switching all the passwords to
random UUIDs which users would never have seen before.

Change-Id: Ie77c622ce1952d03e836bb64167184022a02e902
bug 965335

Resolves unclear formatting of compute extensions documentation at
http://nova.openstack.org/api_ext/index.html

The rst extensions template has been updated to include extension name as
top level hierarchy, and demote all other content.

All existing documentation pages have been reformatted as per the updated
template.

The ext_aggreagates.rst file has also been added to index.rst.

Amendments:
 - Author added to Authors file
 - Typo in ext_volumes.rst fixed

Change-Id: Id67ef91a6e8eaaf4fba46abbd57759c77aaf8991
Merge "Fix libvirt rescue."
Acccept metadata ip so packets aren't snatted

 * fixes bug 968453

Change-Id: I12a7967bb711fe5fd9a7ebc2473209833d33f546