Add missing tests for nova.db.api.agent_build_* methods

blueprint db-api-tests

Change-Id: If8f8a3f02bc0ea73b9174caad60107c7d87f62c0
Raise AgentBuildNotFound on updating/destroying deleted object

Methods below should raise an exception when attempting to operate
with deleted AgentBuild objects:

 nova.db.sqlalchemy.api.agent_build_destroy()
 nova.db.sqlalchemy.api.agent_build_update()

Fixes: bug 1181967

Change-Id: If6df202afb7ea41634c35f7a52988e19677f4d65
Using unicode() to handle image's properties

Replace str() to unicode() to allow nova-api work well with the fix I
did in glanceclient (https://review.openstack.org/#/c/29245/6).

Fixes: Bug #1180377

Change-Id: I31e532bb50e12e355b9dd26c9ce1e129da858cbe
Signed-off-by: Zhi Yan Liu <lzy.dev@gmail.com>
Add node as instance attribute for notification

Fix bug 1181900

In havana release, node is not set as instance attribute and node
indicates the hypervisor where the instance reside in, we should
set node as instance attribute for notification.

Change-Id: I872fba626ef3e321d88cf60fc730df6cf4612c86
Fix config drive code logical error.

Image id has changed to uuid, so bool value can't be a image ID
any more, remove unnecessary test code.

fix bug #1181991

Change-Id: I420e4cdb848401375b347d43e06343efaa7bf5fc
API Extensions framework for v3 API Part 2

This is the second patch for the new extension framework
which is only to be used by the Nova v3 API.

- Adds tracking of extensions loaded and allows
  extensions access to this information
- Adds core API functionality as extensions
  - 'server'
    - Adds an entry point that other extensions can
      use to modify the server create arguments without
      having to modify the server extension itself
    - TODO: Will have to add more entry points as other
      extensions are ported. Delaying adding entry points
      now so they can be tested as they are added.
- Adds port of os-keypairs extension
  - This is an example of a controller extension in the new
    framework
  - This is an example of using the server extension entry
    point to add functionality without modify the core API code
  - Ports tests for the os-keypairs extensions
    - Adds v3 API fake specific code for tests

This completes the bulk of the new extension framework. Porting
of the server tests will be done in future changesets as more
of the core API is ported across as the tests are dependent
on multiple core APIs.

Partially implements blueprint v3-api-extension-framework

Change-Id: Ibadb5bbe808c27d2f4afebe65c06a92576397085
No relevant message when stop a stopped VM

When user tries to stop a stopped VM, there is no need to stop it again,
and We need return it's vm_state.

Fixes bug 1181934

Change-Id: I71772dfcead440cb49b6ccdbb4e1a891475bb75e
Fix internationalization for some LOG messages

Fixes a couple of LOG messages to support internationalisation

Change-Id: Ifba6beb6a33e3969522776114a69def9eaa5262b
Rename policy auth for V3 os-fixed-ips

Renames name used to for policy authorisation for the
V3 os-fixed-ips to os-fixed-ips with a "v3:" prefix (as
per ML discussion)

Change-Id: Ia599c29d7f45153ef47605b6e2a7061fc28ff7cc
Delegate authentication to quantumclient

Quantumclient can deal with authentication, getting the token and
refreshing it when needed. There should be no need for nova to do
those explicitly. Additionally nova can save some time not having
to recreate the Client object on each request.

Fix a couple of places that relied on the exceptions module being
imported inside quantumv2.

Part of blueprint fewer-networking-token-checks
Fixed bug 1177579

Change-Id: I007cef1f0bd688036fa45d79792e6e350c145f05
Support Cinder mount options for NFS/GlusterFS

When connecting to an NFS or GlusterFS volume, use
mount options specified in the "options" field of
the connection_info structure to perform the mount.

This allows the Cinder volume service to specify mount
options rather than only being able to configure them
on the Nova compute node.

Fixes: bug 1185180
blueprint cinder-volume-options

Change-Id: I81a50a2ceb4da4d639f6471b2114a904e5d1a42e
Add tests for some db.security_group_* methods

Introduce SecurityGroupTestCase with tests for
some of the db.security_group_* methods, such as
create, destroy, get, etc.

blueprint db-api-tests

Change-Id: I596c85e3d117fa255e457e05aa845cd1118a2e86
Add missing tests for nova.db.api.quota_* methods

blueprint db-api-tests

Change-Id: I2ecbe7ee30359fa9394869503d363beab105675d
Sync shadow table for 156 migration

To be able to use db archiving our table and shadow table should
have the same columns.

fixes bug 1179502

Change-Id: Ibb0d4708d949d53e17e91307f07bb90a11b9a990
Sync shadow table for 157 migration

To be able to use db archiving our table and shadow table should
have the same columns.

fixes bug 1179504

Change-Id: I08485630a0e31252084e48d403f56da6866e0475
Sync shadow table for 159 migration

To be able to use db archiving our table and shadow table should
have the same columns.

fixes bug 1179507

Change-Id: Ia8a0271505d374456a9ff14d314e80af9bad4a2b
Add db test that checks that shadow tables are up-to-date

This is finally patch for bp db-improve-archiving.
It add new test that checks that:
1) there is no extra shadow tables
2) for each table we have shadow table
3) Tables and shadow tables have the same columns.

blueprint db-improve-archiving

Change-Id: If037ccbb80a880777e8bc2224b0847ccf9413ea2
Fix colorizier thowing exception when a test fails

This failure in colorizier was hidding the actual error
in the tests. If we ran enough tests it also became difficult
to see which test had actually failed.

Fixes: bug 1183602

Change-Id: I806da8f13040b38258de7f3e0fa7b62700bdcead
Add missing os.path.abspath around csrfile.

We need to make sure paths are absolute before passing them to openssl.

Fixes bug 1185052

Change-Id: I3ba9dd0a01d0078f830c33ac3173259985790060
Fix volume IO usage notifications been sent too often.

Each compute node was sending out volume IO usage notifications
for all the volumes in use in the system. This include volumes
hosted on the other compute nodes duplicating the events.

Fix this by getting the conductor to send out the IO usage
notification event immediately after it updates the volume usage
cache table, and only for the effected volume.

Fixes: bug 1182102

Change-Id: Id3216caa482110bdec2b7f5ea13050112e4da009