Let resource_tracker report right migration status

A shutoff instance can be resized, but resource_tracker only think
active instance is in migration state. This patch let it report
right migration status.

Closes-Bug: #1247610

Change-Id: Ic6ce9c7d8fdecaf812831eb302186133f0ee71b1
add hints to api_samples documentation

Based on my own experience and questions I recently answered in
the openstack-nova channel, these hints could help developers.

Change-Id: Id7350f1a6a834b0de8456fdc28c2db890f2971de
baremetal: Make volume driver use a correct source device

attach_volume() have to take the source device path from returning of
LibVirtVolumeDriver.connect_volume() rather than connection_info.

It also adds a test for attach_volume().

Change-Id: I3bee80560342104e2df614066301171624497a04
Closes-Bug: #1208707
Fix limits v3 follow API v3 rules

* Add expected_errors decorator.
* Remove 'absolute_limit' from response, that already return by
extension quota_sets. And update api samples.

Partially implements bp nova-v3-api

Change-Id: Iea3ff494b8abed77fdc4b9e5e552784ed3733c34
Use 400 instead of 422 for invalid input in v3 servers core

We return 400 when input is invalid for v3 api. This patch fix
this case for servers core.

DocImpact

Change-Id: If802d4dcba6ed25f7e9cb9d568a3ffd78f0f6c68
Closes-Bug: 1251538
Fix empty selector XML bug

The XML serialization fails when it's trying to create a datum selector with no
values. In that case the obj is an empty string so the selection of datum from
it just fails.
Instead of raising an exception the fix is returning an empty string, that
allows to serialize Selector with an empty object.

Fixes bug 1223358

Change-Id: If5d564c9b037eb0a107f4688ffa1aceb5281dc42
VMware: Always upload a snapshot as a preallocated disk

Currently, a snapshot operation always produces a preallocated
disk type. When the snapshot is uploaded to glance, the source
image metadata is uploaded with the new snapshot and then some
of the metadata properties are updated. The update doesn't
include the disk_type property, this can be problematic. If
the original image has a sparse disk type and a snapshot is
taken, then the snapshot which is a preallocated disk type is
uploaded to glance with the disk_type property set to sparse,
which creates a disk type mismatch and causes errors when a vm
is spawned from that snapshot. This patch addresses the issue
by correcting the image metadata used when uploading a snapshot
to glance.

Also, the image_upload function in vmwareapi/fake.py has been
modified to address the change. Any function call to
image_upload (from the unit tests) will assert that the
metadata for the image to be uploaded must have the disk_type
value to be preallocated.

Closes-Bug: 1247296
Change-Id: I71cfa8d4d1eb7911abb489153292fb0d1e614765
Clean up how test env variables are parsed

Oslo and cookiecutter and other projects were using
variable to parse test environment vaiables. Let us
do this in Nova

This is copied from 739627bf79619f8 Use cleaner version from
cookiecutter OpenStack template

Change-Id: I4c2b4072981985e7632fc775ffc98216fbfc0508
Change evacuate test hostnames to preferable ones

The hostname grammar in RFC952 does not allow for underscores in
hostnames. However, some evacuate tests use them in each hostname.
This patch changes them to hyphens instead.

Change-Id: Id961e74a0bbeefbc843678edd74c02466b6d6885
Sync log.py from Oslo-incubator

This change syncs log.py and it's dependencies from Oslo-incubator to
include the password sanitation fix that landed in Oslo with commit
76b0cd10c414ae71e6f041adb431460b3337c63d.

The following is a list of the change IDs that this
commit is bringing in from the last sync of Oslo-incubator with
respect to the files we are touching.

2b40a10 python3: Fix UserString import
c331e74 Enable multiple translation domains for gettextutils
89369c3 gettextutils: port to Python 3
6d49bca Translate all substitution elements of a Message object
3970d46 Fix typos in oslo
88db9c8 When translating if no locale is given use default locale
53ebd30 python3: use six.text_types for unicode()
25c5854 Adds admin_password as key to be sanitized when logging
2251cb5 Do not name variables as builtins
04c1b5a Type check for Message param to avoid AttributeError

Change-Id: Ie4d5929604e3fc057ea09edbbf3adf16f8839a4e
Partial-Bug: #1247217
Use password masking utility provided in Oslo

Implement the mask_password function provided in Oslo-incubator's
log.py. Instead of having a specific version in Nova different from
other projects that are essentially doing the same thing.

Change-Id: I7e04b7d31d4d6959b17b1da9654553042eec70f1
Closes-Bug: #1247217
Add default arguments for Connection class

The fakelibvirt.Connection class, among other things, mocks
libvirt.virConnect which doesn't require any parameters. This is
causing a test to fail.

Change-Id: If77864cb0d0bd1dae20b490b8e87a32a0951b52e
Closes-Bug: 1257876
Misc typos in nova

1. on demands -> on demand
2. Either Network -> Either network
3. unexpected task -> Unexpected task
4. PCI Device -> PCI device
5. key manager -> Key manager

Change-Id: I5a3cb64b38e8851902492c15fda7f63c4fa4f7f0
Closes-Bug: #1255914
Merge "Add default arguments for Connection class"
Merge "add hints to api_samples documentation"
Merge "Sync log.py from Oslo-incubator"
Merge "Use password masking utility provided in Oslo"
Merge "Fix limits v3 follow API v3 rules"
Merge "VMware: Always upload a snapshot as a preallocated disk"
Merge "Clean up how test env variables are parsed"