all_tenants=0 should not return instances from all tenants

Fixes set up of server list filters so specifying all_tenants=0
or all_tenants=False when requesting a list of servers does not
result in instances from all tenants being returned.

Change-Id: I72575e4e2cf9019cfd5bf3b07ada53cadf2001e2
Closes-Bug: #1240347
Move get_all_tenants policy enforcement to API

Cleanup to move the enforcement of the get_all_tenants policy
enforcement to the API level. The all_tenants search option in
compute/api.py is only used to trigger policy enforcement while
the logic required by all_tenants (not specifying a project_id or
user_id filter) already resides in the servers API. The flag does
not need to be passed to the db level as it is ignored at that
level anyway.

Partially implements blueprint nova-v3-api

Change-Id: I5200c8912596ffbd32c5f7c6d74939782ff70260
Enforce compute:update policy in V3 API

Now that compute/api.py:update() is no longer being called for instance
updates the policy check is no longer enforced.  This adds policy
checking back in at the V3 API level so that the compute:update policy will
continue to function as it did before.

This was fixed in I365ad8ac2845d914deefb841c314a50f4869dba0 for the V2
API.

Change-Id: I9caa3e10fe029569c6fd467e7b86103dd6590f9b
Closes-Bug: 1242955
Sync log from oslo

5fef5a8105 allow keeping of existing loggers with fileConfig
fb8075a19d Add amqp=WARN,qpid=WARN to default_log_levels
4654a5d247 Don't override default value for eventlet.wsgi.server logging
41ddd7a975 _get_log_file_path explictly return, when logfile/logdire unset
e12e6b45f8 Make openstack.common.log Python 3 compatible
572cfecb4d Make Messages unicode before hitting logging
3243cdfbe9 python3: handle module moves in log

DocImpact

Change-Id: I7bd940a9a2dd4af3d876f2acc650f18675ca177b
Clean BDM when snapshoting volume-backed instances

When snapshoting a volume-backed instance, its block device mapping is
copied entirely into the image properties of the resulting snapshot.

This may lead to some errors when booting from that snapshot because the
fields 'id', 'insance_uuid' and 'connection_info' must be generated for
each instance instead of reusing the ones from the original instance.
For example, sharing the connection_info will cause the new instance to
try to connect to the original volume instead of creating a new one.

This patch cleans all the database-specific plus the connection_info
fields from the block device mapping when creating the snapshot.

Change-Id: I4190e9519d641c61b00b5d86c3885f2ae4fa86f3
Partial-Bug: #1246327
Process image BDM earlier to avoid duplicates

If the block device mapping from the image properties are not handled at
the same time as the ones defined from the API, we might make the false
assumption that the instance has no root and failing or, in the case
we're booting from an image that only defines a BDM and has no disk,
creating a local disk BDM as root and ending up with two root devices
which is forbidden.

This patch moves the handling of the image block device mappings to the
same method were we check the ones provided throught the API. This
allows nova to decide wether the instance needs a local disk from an
image if no root device is defined in any of the block device mappings.

Change-Id: Ide95357895ab4dd1338ab5ee3ec25294af1d010b
Closes-Bug: #1246327
Cache compute node info in Hypervisor api

When extend hypervisor api, it would be much better to cache the
compute node info like is done for instance and flavor requests.

Partially implement blueprint pci-api-support

Change-Id: I73a96db7beb4cc0f017008f81e9f671382ad9105
Add v3 api samples for availability_zone

This patch adds api sample tests and api samples for availability_zone.
Because the detail's response use host name as the key of dict and samples
tests didn't support replacing key with variable, so startup nova's service
with specific hostname instead of uuid.

Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification

Change-Id: I9090a73a8293f26d63744a10d7ffbfc887e37e7c
Add v3 api samples for scheduler-hints

Adds api sample tests and api samples for scheduler-hints

Partially implements blueprint v3-api-unittests
Partially implements blueprint v3-api-specification

Change-Id: If7bc47dc92c1e7f33f80ea567688d067c42fa219
Add V3 api samples for access_ips

Adds api sample tests and api samples for access_ips

Change-Id: I9d9249a48e7f7ccdff0146fbe5b25463d66a93a7
Rename InstanceType exceptions to Flavor

Goes through and renames the various exceptions with InstanceType in the
name or message string to use Flavor instead.

Part of bp flavor-instance-type-dedup

Change-Id: I59d77086af0747f95ad61a569e784b766c8909a9
baremetal: refactor out powervm dependency

For some reason part of the baremetal driver was
importing some of the common modules from the
powervm driver. This change moves the code baremetal
was using into a new baremetal only module to remove
the strange cross driver dependency.

Change-Id: Id5f48bed4ecff7cd776346b34c34f3a2094f2296
Merge "baremetal: refactor out powervm dependency"
Merge "Rename InstanceType exceptions to Flavor"
Merge "Add v3 api samples for scheduler-hints"
Merge "Sync log from oslo"
Merge "all_tenants=0 should not return instances from all tenants"
Merge "Cache compute node info in Hypervisor api"
Merge "Move get_all_tenants policy enforcement to API"
Merge "Enforce compute:update policy in V3 API"