delete deleted image 500 bug

Fixes bug 1138666

When you delete an image that you just deleted, you get a 500 Internal Server Error.
In this case, the problem isn't an internal server error but the "unauthorized" response
from the image service is not expected.

This can be recreated with devstack:
 1) delete an image
 2) delete the same image

Here's an example:

$ nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID                                   | Name                            | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| caa6c969-0f32-466b-8e8e-a7e0ac835470 | cirros-0.3.1-x86_64-uec         | ACTIVE |        |
| 8af603da-b69f-49c6-8e52-25632eccb31c | cirros-0.3.1-x86_64-uec-kernel  | ACTIVE |        |
| fe67d4e1-baca-4968-8638-2314373b620b | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE |        |
+--------------------------------------+---------------------------------+--------+--------+

$ nova image-delete caa6c969-0f32-466b-8e8e-a7e0ac835470

$ nova image-delete caa6c969-0f32-466b-8e8e-a7e0ac835470
ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-1254f8a5-8dda-444a-a077-2072ab3baa6a)

If you delete a deleted image, the server should respond with '403 Forbidden'
because the image still exists and no user is allowed to delete a deleted image.

The fix is to catch the exception from the image service and
convert it to a wsgi exception for '403 Forbidden'.

Change-Id: I2f14687d5468b67389f5dd6ab338ceb54e8a29bb
Libvirt driver create images even without meta

This patch allows the libvirt driver to call _create_image and
create instance directory and other needed images even when there is no
image metadata specified.

As an added bonus, this patch refactors the code of _create_image
method a bit to make it more clear to the reader when some of the images
will and will not be created, especially with regard to booting from
volume.

Fixes bug: 1124441
Fixes bug: 1131913
Fixes bug: 1123274

blueprint: improve-boot-from-volume

Change-Id: I5a028dc0585876d35be4fb86df3a423d89e054ee
Extended server attributes can show wrong hypervisor_hostname

When using the extended server status (EXT-SRV-STS) extension, it might
produce the wrong hypervisor_hostname on multi-node drivers like baremetal.

The db query used is incorrect and in fact not needed anymore, since the info
is already available in the instance dict itself.

This patch resolves the issue by instead using instance['node'] directly
and further removes the no longer used compute_node_get_by_host query.

Resolves bug 1135506.

Change-Id: I641c4f59a088754fe68378ae4bf217c59056b1d1
Add ability to control max utilization of a cell

Add a 'reserve_percent' config flag to cells to control the
maximum free capacity that a child cell will be advertised to its
parent(s).

This gives the ability to leave some reserve capacity
in child cells for operational maintenance.

Change-Id: I1dae1eae4f61ca8079c6f24e60176c31fd8a759d
Simple syntax fix up.

Change-Id: I3a77ed050b37432f29cc2e51822af71d08c999ad
Imported Translations from Transifex

Change-Id: I3b7b3839e12371e998003c36a6ce2f50e13c23f8
Correct exception args in vfs/guestfs.

Updates the exception formatting in vfs/guestfs so that we
properly raise in cases where there is no root or multiple
roots.

Fixes a TypeError that would occur with the previous code.

Fixes LP Bug #1153414.

Change-Id: I28f9cde5a2da466ebb7397176baaf051ccd4192b
Server create will only process "networks" if os-networks is loaded.

When working with a quantum configuration and multiple networks you
have to be able to pass in the requested network to avoid instances
being attached to all networks, so this part of the request isn't
really optional in practice

However the os-network extension is not fully compatible with
quantum, and the operations do map very well. For example:

- Network creation has a set of options that are pretty nova-nets
  centric (such as VLAN)

- Network creation is limited to admins

- Network association and dis-association from projects is not
  the quantum model

- cidr from quantum is not shown correctly in the output of nova
  network-list and network-show

Rather than needing the os-networks extension to loaded and
thereby exposing a bunch of calls that don't really map to
quantum, it would be better to also allow processing of "networks"
when the network api is configured to be quantum

Fixes bug #1150250

Change-Id: I0cc1faf6417d7a004dd9f0ff772860237fc94c57
Rewrap two lines.

No functional changes. This just makes grepping for qemu-img calls a bit easier.

Change-Id: Ifa91a981975bc3766a0f701ee72e5718ff4bec68
Merge "Correct exception args in vfs/guestfs."
Refactor db tests to ensure that notdb driver is used.

Resolves bug 1076023 by refactoring to ensure that the notdb driver
is used for these tests.

Change-Id: I94674d20c8fa320a5855bfa94eb694703fa23326
Merge "Simple syntax fix up."
Merge "Server create will only process "networks" if os-networks is loaded."
Merge "delete deleted image 500 bug"
Merge "Add ability to control max utilization of a cell"
Merge "Refactor db tests to ensure that notdb driver is used."
Merge "Libvirt driver create images even without meta"
Merge "Extended server attributes can show wrong hypervisor_hostname"