Fix traceback when detaching volumes via EC2

When detaching a volume from an instance it results
in the following traceback:

Cinderclient connection created using URL: http://192.168.1.103:8776/v1/bc02ec05c5fa4a5bb3020b617f3574e2
2012-08-06 18:58:32 ERROR nova.api.ec2 [req-1fd2f017-8a11-481f-b901-ae61d3f55c94 demo demo] Unexpected error raised: 'instance_uuid'
2012-08-06 18:58:32 TRACE nova.api.ec2 Traceback (most recent call last):
2012-08-06 18:58:32 TRACE nova.api.ec2   File "/opt/stack/nova/nova/api/ec2/__init__.py", line 474, in __call__
2012-08-06 18:58:32 TRACE nova.api.ec2     result = api_request.invoke(context)
2012-08-06 18:58:32 TRACE nova.api.ec2   File "/opt/stack/nova/nova/api/ec2/apirequest.py", line 81, in invoke
2012-08-06 18:58:32 TRACE nova.api.ec2     result = method(context, **args)
2012-08-06 18:58:32 TRACE nova.api.ec2   File "/opt/stack/nova/nova/api/ec2/cloud.py", line 799, in detach_volume
2012-08-06 18:58:32 TRACE nova.api.ec2     self.compute_api.detach_volume(context,volume_id=volume_id)
2012-08-06 18:58:32 TRACE nova.api.ec2   File "/opt/stack/nova/nova/compute/api.py", line 1642, in detach_volume
2012-08-06 18:58:32 TRACE nova.api.ec2     instance_uuid = volume['instance_uuid']
2012-08-06 18:58:32 TRACE nova.api.ec2 KeyError: 'instance_uuid'

By the time the volume in the cinder database the instance_uuid is already 'NULL',
so get the instance_uuid from the volume before its detached.

Fixes LP: #1033713

Change-Id: Id5515881b08af9d0832b4b620c03e471fdff0823
Signed-off-by: Chuck Short <chuck.short@canonical.com>
Fixes KeyError when trying to rescue an instance

When rescuing an instance, a KeyError exception is thrown since
the 'injected_files' key doesn't exist in the instance dict.

Change-Id: I733899c3f699803db4dbe95021b1cb6490392bed
Adds ability to inherit wsgi extensions

Needed for blueprint disable-server-extensions

It is possible to create a wsgi resource that extends another
resource by using the same controller, but any extensions that
have been applied to the original resource will have no affect.

This adds a new parameter to ResourceExtension that allows it
to inherit extensions from another resource. This is necessary
because we are moving key funcionality of the /servers resource
into extensions, and some other resources (like create-server-ext)
extend that functionality. This way we can keep the functionality
of the other extensions.

Change-Id: I21b4c2569c35d59c1f466642355564084a277aea
Fix setting admin_pass in rescue command

Fixes bug 1034948

The database doesn't have an admin_pass column, so the instance_update()
call is a noop.

Change-Id: I9f22de1e926ed48b8fd4561ddf2129db6a1e0b65
Fix stale instances being sent over rpc.

There were a number of places in compute/api.py that were calling
self.update() for an instance, but not sending an instance that contains
those updates over rpc.  This patch fixes them.

The changes to the unit tests were required because its stubs were
returning an instance without a host set in some cases.  So, the result
of self.update() had no host and the rpcapi would blow up since it had
no idea where to send the message.

This patch does not fix self.update() before prep_resize, because it is
being addressed in this patch: https://review.openstack.org/#/c/11050/

Change-Id: I4efc922a6a0af0605d4d63012d55ff8473211fd5
Merge "Fix setting admin_pass in rescue command"
Merge "Adds ability to inherit wsgi extensions"
Send updated instance model to schedule_prep_resize

A stale instance model was being passed to schedule_prep_resize.

Fixes bug 1034595

Change-Id: Ic92a22a2c315d25c70d32685fdf9f38451077b9a
Merge "Fix traceback when detaching volumes via EC2"
Merge "Send updated instance model to schedule_prep_resize"
Merge "Fix stale instances being sent over rpc."