port baremetal_nodes API into v3 part1

This changeset only copies the v2 files into the appropriate v3
directories unchanged. The copy as-is will not be loaded by either
the v2 or v3 extension loaders. The second changeset will then
make the changes required for it to work as a v3 extension.

This is being tried in order to make reviewing of extension
porting easier as gerrit will display only what is actually
changed for v3 rather than entirely new files.

Change-Id: I180bbf7306e7d3bffa4d6093fedfd52e4baf5215
port BaremetalNodes API into v3 part2

This patch contains the changes required to adapt the BaremetalNodes
extension and the corresponding unittest to the v3 framework

Change-Id: Iceef736a3821a4628afc34be29a04766421d3e47
Add expected_errors for extension extended_volumes v3

Partially implements bp v3-api-extension-versioning

Change-Id: I724cf10f23eead727ad3a91ab0b313524f68ca52
Add rpcapi tests for shelving calls

Adds tests to verify that compute RPC calls have the correct version and
pass the correct arguments.

Change-Id: Idb931139d3a7e6f47cbb474807c619f0ae3cd4fb
xenapi: Pass string arguments to popen

The current BitTorrent code was passing integer arguments to `make_subprocess`
which would in turn pass those to `popen`. This would cause a failure because
the semantics of the underlying `execve` function is to only accept a list of
strings.

The solution is to cast the arguments to a string before passing them into
`make_subrpocess`.

Fixes bug 1201594

Change-Id: I8372795ca032420641c449cb07bb47f9252ff4ef
Fix iptables rules when metadata_host=127.0.0.1

When metadata_host is set to 127.0.0.1 metdata_forward will use the
REDIRECT target instead of the DNAT target in iptables rules. The
REDIRECT target results in an implicit DNAT to the primary address
of the incoming interface. As a result requests coming in from VMs
will have a destination address of the gateway brought up by
nova-network.

metadate_accept will now allow traffic destinatined for any local
address on the metadata_port when metadata_host is set to
127.0.0.1.

Change-Id: I877befe6f7c1020d2160194b6f6cab8297cb086c
Fixes: bug #1202356
Per-project-user-quotas for more granularity

Implements blueprint per-user-quotas.

Fixes bug 968175

Based on the original quotas structure.

NOTE:
quota_instances, quota_cores, quota_ram, quota_key_pairs and
quota_security_groups are supported per user.

Add CRUD methods for project user quotas API. DocImpact
 - Shows quotas for a user.
   GET v2/{tenant_id}/os-quota-sets/{tenant_id}?user_id={user_id}
 - Updates quotas for a user.
   POST v2/{tenant_id}/os-quota-sets/{tenant_id}?user_id={user_id}

Add commands for project user quotas management.
 - Show user quotas:
   nova-manage project quota --project <Project name> --user <User name>
 - Update/Create user quotas:
   nova-manage project quota --project <Project name> --user <User name>
   --key <key> --value <value>

Change-Id: I24af1f6bc439d5d740303c6fe176a9bffe754579
xenapi: Fix console rotate script

First time run of the console rotate script failed, due to the fact that
the logs did not exist at that time.

Fixes bug 1204440

Change-Id: I49b5569c1ba3349d911caace42685fa0f19a1f66
Fix policy failure on image_metadata calls

Image metadata create/update/delete calls were not catching failures
returned by Glance and translating them into nice returns for API
callers.  Now ImageNotAuthorized failures are caught and passed back to
the caller as 403s.

bug 1204646

Change-Id: Ib9e451531d8102b6089e2cfc9be16d1bd635d59d
Fix failing network manager unit tests

* Instance uuid was not returned by the mocked methods of some
  network manager unit tests causing them to fail with KeyError.

Fixes bug #1204810

Change-Id: Iee04872ea954c2c59b1bf24e7cb0058c59ae8a84
Don't pass empty image to filter on live migration

If live migration for a volume backed instance without an image supplied
is initiated with no destination supplied, glance client show will not
be called and the image variable will be set to None.

However if passed to filters like that as part of the request_spec
dictionary, None value will cause one of the default filters - the
ImagePropertiesFilter to throw an exception in it's host_passes method,
as it expects an image to be a dictionary.

We solve this by leaving out the image entirely before engaging filters,
and not attempting to get it if it was not supplied to the instance.

This bug was previously fixed (however not fully, as the None image
would still cause an exception) in the following patch:
Ie683a3ca5d6430c52ead77b41f98fbcb4114ea1e, but  was accidentally dropped
in I6de33ada6dc377e20f8df07da92244f2c150b9fe.

Fixes bug 1170596 (again)
Fixes bug 1199811

Change-Id: I0239b6ac5640d075f937f9690eca4ce54f534117
Fix leaky network tests

`test_networks.py:test_validate_instance_zone_for_dns_domain` was setting a
config in a way such that it could leak to other tests: using CONF.foo instead
of self.flags(foo=X).

This would cause other tests to break in non-determinstic ways, hence it
landing in trunk (order of tests running mattered!).

The test succeeds with the line removed, meaning it was probably only relevant
in an earlier version of the code, so the solution is to remove it.

Fixes bug 1205034

Change-Id: Iaa143a215e285d9b97c10d81bd9916ed3feeb04b
Merge "Fix iptables rules when metadata_host=127.0.0.1"
Merge "xenapi: Pass string arguments to popen"
Merge "Fix leaky network tests"
Merge "Fix failing network manager unit tests"
Merge "Add rpcapi tests for shelving calls"
Merge "Fix policy failure on image_metadata calls"
Add latest oslo DB support

The common oslo code is backward compatible.

The database configuration variables are now in a new section
[database].

DocImpact

Change-Id: I978493f692179ecf09ea9ed98d521b3e65394880
Merge "Add expected_errors for extension extended_volumes v3"