Fix AvailabilityZone check for hosts in multiple aggregates

Check for multiple AZ was distinct when adding an host to an aggregate
and when updating an aggregate (or its metadata), which was leading to
possible corner-cases where logics were different.

This patch proposes a single way for checking for both API methods and
also adds an extra control on the possibility to have an aggregate with
its metadata AZ set to the configuration default value (eg. 'nova') and
where it was possible to subsequently have one host in two disctinct AZs
Fixed that scenerio as it is a gap, Nova as of now preventing to have
one host in two distinct AZs.

Change-Id: Ida6aa507f34f36a436adaafe1f7609963c59a9bc
Partial-Bug: #1277230
Add specific doc build option to tox

Add doc venv to align with other OpenStack projects (such as keystone,
heat and nova-specs) who are using 'docs' for there doc builds.

Change-Id: I37771db339d864b2b938d1c02d15d38b07093493
Set the volume access mode during volume attach

cinderclient supports an optional keyword argument named 'mode'
for volumes.attach(), which allows you to set the access mode of
a volume at attach time. The keyword argument is not passed in
by nova when it attaches a read-only volume, making the volume
access mode default to 'rw' instead of the desired 'ro'. This
patch finds the access mode of the volume and passes it to
cinderclient, so the correct access mode is used at attach
time.

Change-Id: Ib62f454292e60114f96debbad96c4a356dc32a21
Closes-Bug: #1307088
Fix a minor comments error

Seems a copy-paste error. This test case is test bigger than oversize
limitation.

Change-Id: Ie0ce557032b62a0d3a955a5b7ce8bbbe41fef7cd
Correct pci resources log

In _report_final_resource_view() method, Nova will never record
"free pci" in log message because 'pci_devices' is not in dict 'resources'.

Closes-bug: #1314008

Change-Id: I90f1e3c624922c39e47f5e1fcccc7e33139d54e7
Add log translation hints.

Oslo would like to see hints like this in all of our code by the
end of juno. I'll slowly trickle the changes out over the
release.

Change-Id: I5aa89ec5e1abd7222967467261de9fecb3afa57b
Defer applying iptable changes when nova-network start

When restarting nova-network service, nova-network will initialize iptables and
remove old rules, then add floating ip iptable forward rules one by one.

If there are a lot of floating ips on one host, the process of adding floating
ip rules could last several minutes, which will cause those floating ips that
last added iptable rules disconnected for same time.

This patch defers applying nova-network iptable rule changes until
initialization is done instead of adding floating ip forward rules one by one.

Change-Id: I12651850b44790aef3817fedacae050bff57e364
Closes-bug: 1308390
Fix typo in comment

This is a trivial change, fixing a spelling mistake in a comment.

Change-Id: I124faf67bc2b3596a2ecf88c66c57f3abb362fd9
Merge "Add log translation hints."
VMware: uncaught exception during snapshot deletion

During the image upload of the snapshot to glance, an exception is
thrown that ends up getting ignored.  As a result, the instance gets
stuck in the "Image Uploading" state.

Change-Id: Id2cb3c244edd831939794da9dcc1fd9fce59991c
Closes-bug: #1249519
Merge "Correct pci resources log"
VMware: use default values in get_info() when properties are missing

The properties that we retrieve from VirtualMachineConfigSummary are
optional ('summary.config.numCpu', 'summary.config.memorySizeMB') and
if they are missing we should return default values from get_info()

This patch also improves the unit test for get_info(). It removes the
test in test_driver_api.py (test_get_info() and test_spawn() are the
same) and adds a new test in test_vmops.py

Closes-Bug: 1317912
Change-Id: Ibbb28985d13de371fdac8a119ad820d25acc21be
Merge "VMware: uncaught exception during snapshot deletion"
Add a reference to the nova developer documentation

I've showed these docs to more people than I care to. It would be
extremely helpful to reference them in HACKING, which is generally
the first thing people read if they intend to hack.

Change-Id: I9194d98f5525e29711b4a1b26414a50b8ceba525
On rebuild check for null image_ref

While parsing the body passed in a rebuild request there is no check to
ensure that image_ref is not None.  This leads to a raised exception and
500 response by the API.

Change-Id: Ic9e51a761d0c1f30d55f4a167c876a6aa4f00a41
Closes-bug: 1312278
Merge "VMware: use default values in get_info() when properties are missing"
Merge "Fix typo in comment"
Merge "Add a reference to the nova developer documentation"
Make hacking test more accurate

Hacking check returns tuple or None, assertTrue/assertFalse doesn't
handle the return results properly. For example, non-tuple return value
also can pass the hacking unit test method.

  * use assertEqual or assertIsInstance instead of assertTrue
  * use assertIsNone instead of assertFalse
  * remove duplicated test data in method test_virt_driver_imports

Change-Id: Iee8b466c3ab2c6437144367cdb874bd2f8839984
Merge "On rebuild check for null image_ref"