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>
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
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
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
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
Merge "API Extensions framework for v3 API Part 2"
Don't delete sys_meta on instance delete

Unfortunately, we require to access instance_system_metadata to get
data (specifically at least instance_type data) for instances that have
been deleted.

There's 2 cases where this is true:

1) nova-api supports showing deleting instances when you specify a
'changes-since' param.
2) The _usage_audit_log periodic task pulls all instances during the
audit period, which includes instances that have been deleted during
that period.

This reverts commit 17bca438954638d74035d560e826a26a532b3ea3, which was
attempting to fix a bug where we leave instance_system_metadata entries
undeleted from the DB.  There's not an easy way to query for the deleted
sys_meta data in an efficient manner, and leaving the entries undeleted is
the lesser of the 2 evils for now.

Fixes bug 1185190

Change-Id: I898f0546c49126dcc56a4237120082f95dc82304
Merge "Using unicode() to handle image's properties"
Merge "Add missing os.path.abspath around csrfile."
Merge "Fix volume IO usage notifications been sent too often."
Merge "Add tests for some db.security_group_* methods"
Merge "Don't delete sys_meta on instance delete"
Merge "Rename policy auth for V3 os-fixed-ips"