Need to allow quota values to be set to zero

There are test cases in tempest setting the value of quota to '0', we
need allow this scenario.

Fix bug 1191336

Change-Id: I205b523eddfcd3c253172ad4549142ceb9f9ee4e
Remove docstrings in tests

Remove docstrings introduced in Change
Ie0406c1d4b47a51473979910c0908b153497d503

Change-Id: I60677fb585b7ef436ac655ba1bc8f04cd1f99833
enhance description of share_dhcp_address option

It is easier to understand how the option works.

related to bug #1092347.

Change-Id: I843c36c24e82ee26054430e4bd3bdcf4110e4f90
Fix a typo in test_migrations for migration 209

Happened to see that typo asserFalse and fix it.

Change-Id: I3aab9f1f7f5d253ca72a907d12eecfdbeeeaf981
Signed-off-by: Shane Wang <shane.wang@intel.com>
Remove duplicate test from V3 version of test_hosts

Removes duplicate test_host_startup_service_unavailable
test.

Partially implements blueprint v3-api-unittests

Change-Id: I87327fa577666bcd2924432253d02cd67865e948
maint: remove redundant disk_cachemode validation entry

* nova/virt/libvirt/driver.py (LibvirtDriver.__init__):
Remove a redundant duplicate entry, which would just
slow checks down slightly.

Change-Id: I7b5f7bf2cb00a45f88dbd3e3b6b4e339af49c8d8
Should finish allocating network before VM reaches ACTIVE

This patch can fix issues like tempest caused by async
network allocation. Nova uses NetworkInfoAsyncWrapper
to allocate network in an async manner, and this allows
one to start querying for network info before you know
you will need it. Nova will invoke refresh_cache method
to update instance_cache_info after excuting the
allocate_for_instance method as well.

However, nova rest api will query instance_cache_info
directly, thus maybe get the empty network info before
instance_cache_info table has been updated asynchronously.
Thus will cause VM can exist without a known address
accidentally, the caller is difficult to distinguish
this situation, unless waiting for some internal process
or it will not have an address. So should finish
allocating network before the VM reaches ACTIVE status.
For more detail can refer the bug description.

BTW, almost all create server related unit tests have
coverred this case.

Closes-Bug: #1210483
Change-Id: Iab542df1be7d5c9661d717ec596d2a37b975169a
Remove unused _decompress_image_file from powervm operator class

While looking at bug 1214985 I noticed that the _decompress_image_file
method in the BaseOperator class wasn't being used, so this patch simply
cleans that up to avoid future confusion.

Related-Bug: #1214985

Change-Id: Ic6f2010727dcc1dfabc310ffa3bd5ca0b6799537
Add REUSE_EXT in _swap_volume call to blockRebase

_swap_volume is called in cases where new volume file has
already been created.  Add VIR_DOMAIN_BLOCK_REBASE_RESUE_EXT
in the flags passed when calling blockRebase to allow
the existing volume file to be written to.

Closes-Bug: #1218057

Change-Id: I704772ba4bfef474fc788d277c99ba016fb7883f
Sync filetuils from oslo-incubator

to support https://review.openstack.org/#/c/33409/

* nova/openstack/common/fileutils.py: Auto sync from oslo.
* nova/tests/virt/libvirt/test_libvirt.py (fake_rm_on_errror):
Adjust to match the new signature of delete_if_exists()
and handle mocking out the remove parameter to
remove_path_on_error() which is initialized at load time.

Change-Id: I756f1226853366e8f418d21309b0e8dcf8a24aa2
Fix v3 swap volume with wrong signature

Fix bug 1219672

Fix the signature and add related integrated test.
And fix test_servers missing subs 'glance_host'.

Change-Id: I040dafe2c1bcfc014fdeba3f735b322908af96c0
Add test cases for resume_state_on_host_boot

part of blueprint libvirt-driver-tests

Co-authored-by: Hirofumi Ichihara <ichihara.hirofumi@lab.ntt.co.jp>
Change-Id: I234c3613eb30a593fd1b0e29655551694b7e24f7
Makes v3 API keypairs extension core

Adds os-keypairs to the core list for the V3 API.

Rename os-keypairs to keypairs as part of this change.

Fixes some incorrect urls in test_keypairs which still included
the tenant id

Updates api samples for servers since keypairs is now core and forms
part of the response by default

+DocImpact

Partially implements blueprint nova-v3-api

Change-Id: I8cdf52be0c8b19f7704848029a78373da8018cab
Make v3 API console-output extension core

Adds the console output extension to the core list for the V3 API
Renames os-console-output to console-output as part of this change

+DocImpact

Partially implements blueprint nova-v3-api

Change-Id: I947e4bd70192d6f95b598f591aa0546f86c88653
Fix changes_since for V3 API

The V3 API changed the changes-since parameter to changes_since
for consistency with other parameters. However, the db level
expects changes-since as the filter. So this change transforms
changes_since to changes-since before passing it to the compute
layer.

Closes-Bug: 1220045

Change-Id: Id34ffe8aa75b20d11dcb1b4a9ba36e2586dae1e3
Increase volume created checking retries to 60

In some cases 30 retries with 1 sec interval is not enough for
volume to be created.
Increased max tries to 60

Fixes bug 1213953

Change-Id: I6bcd395a4bac940387384cc85691d7219cf90e63
Limit instance fault messages to 255 characters

The instance_fault.message column is a VARCHAR(255).  By default,
MySQL silently truncates entries that are too long.  PostgreSQL
throws an error instead.  So we need to truncate the message field
before we try inserting into that column, to avoid errors from
very long messages in PostgreSQL (or MySQL configured to not allow
this).

Fixes bug #1217167

Change-Id: Ia959d64a8bc162a33ba818f1006e9779207b4796
Fixes misuse of assertTrue in Cells test scripts

Misuse of assertTrue in places where assertEqual should be used.

Fixes bug #1220522

Change-Id: Ide2519a35a0b14daa381e668eea0c98939557883
xenapi: Fix download_handler fallback

In order to make image-download a bit more robust, we attempt to download from
a preferred handler and if that fails, we fall back to a default handler.

If the preferred handler *is* the default-handler, then we should just raise
the exception instead of retrying.

The existing code was checking to see with whether the handler *instance*
compared as equal to the default-handler *instance*. Since the two objects are
instantiated separately, they'll always be different objects, so never compare
as equal.

The correct check is to see if the handler is an instance of the default
handler's class.

Fixes bug 1210659

Change-Id: Id038d221fd2f90c36673f30d4ff8acdc8dbf098e
Add expected_errors for extension aggregates v3

And remove some extra invalid params checking that
we didn't check in most of extensions. We can do
more strict checking when we have API input validation.

Fix bug 1214315
Partially implements bp v3-api-extension-versioning

Change-Id: I9c1f8265ea6e19e48cc2f8e747d04d3c3b66e55d