Fix nova image-show with queued image

Currently, the nova image-show command cannot be used with queued images,
because they don't have certain attributes set yet. Nova will raise
AttributeError, which causes a 500 to be returned from the API.

Change-Id: I7d73b891545492e3e247eebdf02507cb630eb250
Closes-bug: #1321186
Inject expected results for IBM Power when testing bus

There's no support for ide in IBM Power, and this test is
failing when it's being running in Power.
This patch inject the expected value in
test_xml_disk_bus_ide_and_virtio and
test_xml_disk_bus_ide when it's tested in Power
platform, so, when architecture is Power, the injected value
replace the ide by scsi.

Change-Id: I2db1ade0e049c3471989b121b9497bc5124ea567
Raise HTTPInternalServerError when boot_from_volume with cinder down

This patch changes exception type.
Boot_from_volume api raises BlockDeviceMappingIsInvalid exception
when cinder-api is down.
Also it returns response code 400.
It is not exact. Because request is valid.
Exception was changed to raise HTTPInternalServerError and
return a 500 error.

Closes-Bug: #1239952

Change-Id: Iec8839d46e6186fe544b28b0aafc8aa6faad53b7
xenapi: fix live-migrate with volume attached

We need to attach the volume SR on the destination host during
pre-live-migrate, so XenAPI spots the volume is present, and does't try
to block migrate the volume to the destination host, instead it just
connects to the remote volume before resuming the VM on the destination
host.

The fix is done by calling connect_volume instead of attach_volume. The
None passed into instance was causing the lookup of the vm_ref to
(correctly) fail, with:
Failure: ['FIELD_TYPE_ERROR', 'label']

Change-Id: I7eaf90582508b42a202da79072c891c216d137d1
Closes-Bug: #1317208
Refactor test to ensure file is closed

Python requires parentheses to call a method. Without parentheses it
will return the method object which doesn't do anything useful without
an lvalue.

Since we're in here, switch it to be a context manager to be shorter
while making sure the file gets closed.

Change-Id: Ib8b15e286c8bbca1f59c530c9200cb7a781c3d6b
Merge "Inject expected results for IBM Power when testing bus"
Merge "Refactor test to ensure file is closed"
Merge "xenapi: fix live-migrate with volume attached"
Merge "Fix nova image-show with queued image"
Merge "Raise HTTPInternalServerError when boot_from_volume with cinder down"