Add decorator expected_errors for ips v3 extension

Add decorator expected_errors for ips v3 extesion, that's required
for all the v3 extension.

Change-Id: Iad071fd77bd3571087badc1d836275bd64d8dfc8
Add test for get_instance_disk_info to test_virt_drivers

Commit 2bed16c89356554a193a111d268a9587709ed2f7 added
get_instance_disk_info to the base ComputeDriver class
but didn't add a test for it in test_virt_drivers, so
it's added here.

This also fixes the wrong method signature in the fake
virt driver.

Note that this wouldn't have found the problem for the
hyperv or vmware drivers due to bug 1209421.

Change-Id: I5765720d8c3e0a7962b493fa49359514f3136544
Related-Bug: #1358719
Fix NoopQuotasDriver.get_settable_quotas()

get_settable_quotas() always failed with KeyError. While this driver
is not really useful, we still want it to be working.

Closes-Bug: #1363014

Change-Id: Ia6986453338cee05f28ff081c6bb1279072c3d80
VMware: prevent race condition with VNC port allocation

When spawning some instances, nova VMware driver could have a race condition
in VNC port allocation. This fix ensures that the lock is done on the
actual setting in the VM configuration spec.

Co-authored-by: Marcio Roberto Starke <marcio.starke@serpro.gov.br>

Change-Id: I70fab021bbf2df418df53e5f47e19cf16dbe45ac
Closes-bug: #1357372
Fix 'createImage' server actions for V2.1 API

'createImage' server actions was missed for V2.1 API.
This patch converts 'createImage' server action for V2.1 API

The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3.

Change-Id: I5490365c72082b1652ddda2fed97c754fceeed22
Closes-Bug: #1367633
Fix "revertResize/confirmResize" for V2.1 API

"revertResize/confirmResize" server actions were missed for V2.1 API.

This patch converts "revertResize/confirmResize" server action
for V2.1 API

The differences between v2 and v3 are described on the wiki page
https://wiki.openstack.org/wiki/NovaAPIv2tov3.

Change-Id: I24bdb5b28fafeb60ea7b4ff044b12a519498e592
Closes-Bug: #1367642
Fix 'os-interface' resource name for Nova V2.1

V2 and V3 diff for this resource name is below-
V2 - '/servers/os-interface'
V3 - '/servers/os-attach-interfaces'

V3 resource name needs to be changed to work that for V2.1

Change-Id: I37bd7cee7e8879b01a8aee739d74c2dd6e033dc4
Closes-Bug: #1368035
Remove unnecessary imageRef setting from tests

In setUp(), a default imageRef is set already and it is not necessary
to set it in each test if that is not the purpose of the tests.
This patch removes such unnecessary imageRef setting for cleanup.

Change-Id: I2dcf79112d1e6adfbb634bf4c957bbb1238232d8
Fix `confirmResize` action status code in V2

In server`s action `confirmResize` status code in @wsgi.response
decorator is set as 202 but this is overridden/ignored by return
statement (return exc.HTTPNoContent()) which return 204 status code.

This is very confusing and we should have expected status code in
@wsgi.response decorator as consistence with other APIs.

NOTE- There is no change in API return status code. API returns the
same 204 return code as previously.

Change-Id: Id8033fb8880306babebc14b319bce5b3b8798774
Closes-Bug: #1368597
Fix test_create_instance_invalid_key_name

In test_create_instance_invalid_key_name, there were the duplicated
negative factors. One is nonexistent image-id, the other one is non-
existent keypair.
This patch removes nonexistent image-id for the test purpose.

Change-Id: I90ff4e9ca0eeb149aa0db7be2d171561586724e9
Increase sleeps in baremetal driver

The current sleeps are not long enough in some cases, increasing them
very simply makes the driver far more reliable.

Change-Id: Ida5591f9e4d1eb61e229096d541a8285803efeb5
Closes-Bug: #1316350
Add plan for kilo blueprints: when is a blueprint needed

At the nova mid-cycle we agreed that while specs have made our
process significantly better, we think the current approach still leaves
much to be desired. This document is the outcome of the discussion at
the mid-cycle on how we want to manage blueprints in kilo.

This proposal is being placed in devref, as we want to use gerrit's
workflow (two core reviews, inline comments, revisions etc) and this is
a document for developers.

It turns out adding the specs requirement to blueprints adds a
non-trivial amount of overhead, revisit when a blueprint and spec is
needed to minimize overhead in cases where it isn't helpful.

Change-Id: Iaaadc26f3f51ee091419beaa12e0508623eed99e
NIST: increase RSA key length to 2048 bit

According to NIST 800-131A, RSA key lenght for digital signature
must >= 2048 bit. Now we use 1024 bit key to generate x509 cert
file. Need to increase the key length to 2048 bit.

Change-Id: I59f614b5d8a79f9e0a96503867cfca176be5c757
Closes-Bug: 1369487
ironic/baremetal: add validation of host manager/state APIs

Add tests to ensure the ironic & baremetal HostManager and
HostState sub-classes comply with the API contract defined
in their parent class.

Related-bug: #1369151
Change-Id: Ic2cf17c59c06fe2222db4bc5ea0e68f87c4399e9
Record instance faults during boot process

Once a build makes it to the compute manager build_and_run_instance
method no instance faults were being recorded.  This stores the instance
faults appropriately when an instance is placed into the ERROR state.

Change-Id: I348b539d0b5874bac3f7443e6dd4524264ce9766
Closes-Bug: #1355922
VMware: Fix usage of assertEqual in test_vmops

Ensure usage is assertEqual(expected, got)
Convert assertEqual(boolean, ...) to assertTrue/assertFalse

Change-Id: If61e604673a016420bfb23aafd559b1f753906f8
postgresql: use postgres db instead of template1

In PostgreSQL template1 database is kind of special, as all new databases are
copied from it, when you do CREATE DATABASE. This implies a few restrictions:
e.g. you can't have more than one active session to template1, if one of them
tries to create a database. It will fail with:

    ERROR: source database "template1" is being accessed by other users

Using of postgres database instead of template1 resolves this issue.

Closes-Bug: #1355929

Change-Id: I8b1a36163984fbef6be66964456072d32da6a9d0
VMware: Remove host argument to ds_util.get_datastore()

Since the removal of the ESX driver, we no longer pass host to
ds_util.get_datastore(), and we always pass a cluster. This change
removes the host argument, and assumes we always get a cluster.

This is a relatively simple change, but it has 2 knock-on effects to
tests. Firstly, almost all tests using get_datastore were passing host
and cluster as None, None, which excercised a code path which only
made a single vim call. This meant that passing in
fake.FakeObjectRetrievalSession() worked well. That code path was
removed (because it was never actually called), and the new code path
makes either 2 or 3 vim calls. This requires more complex faking of
vim calls, which we do in _mock_get_datastore_calls(). Note that this
is only faking the vim calls, so we're still testing get_datastore,
not the fake function.

The second knock-on effect is to the incredibly fragile
test_spawn_mask_block_device_info_password in test_vmops. This test
has to allow enough of spawn() to run to generate a debug log message,
as it is testing that log message. This change caused an irrelevant
exception to be raised in _get_vm_config_info, which prevented it
getting as far as the log message. We poke the test a bit so it
doesn't break any more.

Finally, we entirely remove test_get_datastore_no_host_in_cluster
because:

1. the previous code did 'if datastore_ret:' so returning '' and None,
   as returned by test_get_datastore_without_datastore, were
   previously functionally identical. Incidentally, this change also
   fixes that.
2. its purpose wasn't clear anyway.

Change-Id: I37f1ea126ae2e7f86cfd29d399fba1c527f18dc0
make flavors use common limit and marker

Flavors REST calls were not using the common limit and 
marker function, which means that the osapi_max_limit configuration
that was set by the operator would not be respected. 

Convert flavors to use the common infrastructure thereby providing
a more consistent experience for users and operators.

Change-Id: Iabbf74cf14ddab9a67092ba966270a658ce6be3f
Closes-Bug: #1304790
Add plan for kilo blueprints: project priorities

At the nova mid-cycle we agreed that while specs have made our blueprint
process significantly better, we think the current approach still leaves
much to be desired. This document is the outcome of the discussion at
the mid-cycle on how we want to manage blueprints in Kilo.

This proposal is being placed in devref, as we want to use gerrit's
workflow (two core reviews, inline comments, revisions etc) and this is
a document for developers.

Introduce the idea of project priorities.

Change-Id: I7075a130c01be22f3ee5315d4a65b8e524b5a1ad