Update block_device_info to contain swap and ephemeral disks

An ephemeral or swap disk is attached to an instance on boot
as follows: nova boot --flavor FLAVOR --image IMAGE_ID
--swap 512 --ephemeral size=2 INSTANCE.  When a hard reboot is
performed on the instance, nova fails to recreate the
appropriate libvirt XML definition, containing the ephemeral
disk.  This is because the correct block_device_info dict that
is passed to the compute manager's reboot_instance method does
not contain swap or ephemeral disk key values that are necessary
to recreate those disks.  In addition to nova boot, the correct
block_device_info dict is also needed by nova rebuild, reboot,
resize, and migrate to recreate those disks.  This patch updates
_get_instance_volume_block_device_info (renamed
_get_instance_block_device_info) to return the swap and ephemeral
disk key values, in addition to the block_device_mapping it
already returns today.

Change-Id: Iec329d1c12a48ea90ba9d57decd0996fde6544f0
Closes-Bug: #1305423
Add fault wrapper for rescue function

we might need to record the unsuccessful action for instance,
rescue function currently don't have this method. This patch add
it so that it will record failed rescue action into db.

Change-Id: I615089e7562262dc286a55a2c7228be3201d6d94
Don't translate debug level logs in cloudpipe, hacking, ipv6, keymgr

Our translation policy
(https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls
for not translating debug level logs. This is to help prioritize log
translation. Furthermore translation has a performance overhead, even if
the log isn't used (since nova doesn't support lazy translation yet).

Change-Id: Icdae100d5a506fdaa56fd124dc9860cdfddbe288
Don't translate debug level logs in objectstore, pci, rdp, servicegroup

Our translation policy
(https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls
for not translating debug level logs. This is to help prioritize log
translation. Furthermore translation has a performance overhead, even if
the log isn't used (since nova doesn't support lazy translation yet).

Change-Id: I4c8e7365e1e3bae52956249f1c7d97c7729aebc3
Raise descriptive error for over volume quota

If you attempt to create a new instance booting from an image and you
were over your quota on cinder, the nova manager would see that as an
invalid block device. This raises a more descriptive error message in
the logs.

Closes-bug: #1013417
Change-Id: Ie50b97c31580da7fc38c6891d1f3646b91f8aa10
libvirt: Stub O_DIRECT in test if not supported

`os.O_DIRECT` is only defined on platforms that support direct I/O. On
Macs, which don't support direct I/O in this way, `os.O_DIRECT` will
raise an `AttributeError`.

We can still test the code-path, however, by just stubbing out the
value on platforms where it's not supported.

Closes-Bug: 1286958

Change-Id: I8f10d6dfc4a63b6a961006b029b828e703870e46
Remove duplicated import in unit test

A couple of unit tests were importing twice mock or mox.
This patch just remove the duplicated import.

Change-Id: I0c66746348e184a3846cadd40d7d7cbb7d594564
VMware: reduce unit test times

A number of tests would take longer than a second.

Closes-bug: #1315870

Change-Id: I4d5c9fac460278135ab1c2c7876f3ac6e6f3d4a6
Fix calls to mock.assert_not_called()

There is no assert_not_called() method in mock, as described here:

https://code.google.com/p/mock/issues/detail?id=159

Fix these calls to use the mock.called attribute instead.

Closes-Bug: #1316167

Change-Id: I865463244ebfc45e1f940c74e1afbb9084930bb3
Improve hacking rule to avoid author markers

The case with the tag "moduleauthor" is not handled when
checking to avoid author makers.
Also fix the position when the tag Author is used.

Change-Id: I17b07b9f5448f9cbb4c5705f655c5392316a6239
Closes-Bug: #1314176
Raise HTTPForbidden from os-floating-ips API rather than 404

The os-floating-ips extension was catching and handling a 404
and 403 in the same block and raising HTTPNotFound for both.

This change separates the 404 and 403 cases so HTTPForbidden
is returned in the 403 case.  For the 404 case, the test is
updated to raise the proper NovaException and a new test is
added for the 403 Forbidden case.

Change-Id: Id0daf2d61c6960d845d3b7980f96228fece41128
Merge "Add fault wrapper for rescue function"
Merge "Raise descriptive error for over volume quota"
Merge "Raise HTTPForbidden from os-floating-ips API rather than 404"
Merge "Remove duplicated import in unit test"
Merge "Update block_device_info to contain swap and ephemeral disks"
Merge "Improve hacking rule to avoid author markers"
Merge "VMware: reduce unit test times"
Merge "libvirt: Stub O_DIRECT in test if not supported"
Merge "Fix calls to mock.assert_not_called()"