Add flavor-access to core for V3 API

Adds the flavor-access plugin to the core list for the V3 API.
This is part of the process of adding all of the flavor related
extensions to core, with the exception of rxtx, as per the discussion
here: https://etherpad.openstack.org/p/NovaV3APICore

Note that since the alias changes from os-flavor-access to flavor-access
the api samples move directory and quite a few of other api samples
as well as flavor access is included by default.

Partially implements blueprint nova-v3-api

DocImpact

Change-Id: I9abc7df8f4620d462b0d381a2c0ed180c48f220e
Add flavor-extra-specs to core for V3 API

Adds the flavor-extra-specs plugin to the core list for the V3 API.
This is part of the process of adding all of the flavor related
extensions to core, with the exception of rxtx, as per the discussion
here: https://etherpad.openstack.org/p/NovaV3APICore

Partially implements blueprint nova-v3-api

Change-Id: Id4b4fad5e584bdf2bbbaaae579a07e28c312ef34
Remove V3 API version of coverage extension

As discussed at the summit in the QA session, this removes
the coverage extension from the V3 API. The coverage extension
doesn't work properly and has security issues. An alternative technique,
though more limited in nature will soon be proposed.

Partially implements blueprint nova-v3-api

Change-Id: Ib4296288fefeb7e1e11bb6e44bd1cf355f29b9b9
Remove V2 API version of coverage extensions

As discussed at the summit in the QA stream, this removes
the coverage extension from the V2 API.

According to the API Change Guidelines
https://wiki.openstack.org/wiki/APIChangeGuidelines
we should not be doing this. However the coverage
extension is a rather special case. It has security issues
such that it shouldn't be used in a production cloud
environment. It also doesn't work properly so its usefulness
to measure API coverage is limited. And in the past the presence of
this plugin has been used as a reason not to accept
an alternative technique to measure API coverage.

This is the proposed replacement

https://review.openstack.org/#/c/25882/

Change-Id: I07d798129ee277a6f7691c25f88c07a5204c0943
Add a driver method to toggle instance booting

Add a driver method to toggle the ability to boot an instance.

The only implementation provided is for the xenapi virt driver.  Other
drivers will log a warning and treat the method as a no-op.

Implements: blueprint cleanup-running-deleted-shutdown

Change-Id: Ie448c681d653b126cb12d3a48d79ab4febde8828
objects: declare some methods as static

A lot of code is composed of static methods, but they are not declared
as is.

Change-Id: I64be630b560e331aed9d1ab9a68152da52eb0d82
baremetal: Make api validate mac address

Check if the address in the form of xx:xx:xx:xx:xx:xx.

Closes-Bug: 1238595
Change-Id: Idcba745a011604d7664b62d88f1dede88d10443d
Pass Instance object to spice compute rpc api

Update the get_spice_console() method of the compute rpc api to take in
an Instance object instead of a dict.  The object_compat() decorator is
used to maintain backwards compatibility with receiving a dict.

Change-Id: I0bafe18d9c8bffcd0b72629542fbf7aedacdfbb4
Move flags in libvirt's volume to the libvirt group

This change continues moving libvirt specific flags into a libvirt
specific configuration group.

Progresses blueprint libvirt-opts-group.

DocImpact: the following flags have moved into the libvirt group:
    num_iscsi_scan_tries
    num_iser_scan_tries
    rbd_user
    rbd_secret_uuid
    nfs_mount_point_base
    nfs_mount_options
    num_aoe_discover_tries
    glusterfs_mount_point_base
    iscsi_use_multipath (formerly libvirt_iscsi_use_multipath)
    iser_use_multipath (formerly libvirt_iser_use_multipath)
    scality_sofs_config
    scality_sofs_mount_point
    qemu_allowed_storage_drivers

Change-Id: I78941aff4bf49fc70d91a3239deff44dbaaab6c9
Fix testcase config option imports

Fixes some testcases where config options were used before they
were guaranteed to be imported. This was causing intermittent
failures of tests such as test_shelve_offload.

Closes-Bug: 1256210

Change-Id: Id0204d67f35cb098a4ddfb670f5968e76b327705
VMware: enable driver to work with postgres database

The hypervisor version is expected to be an integer and not
a string.

Change-Id: Ifac9ca3480191413e3a02f0dae94e452707ae82f
Closes-Bug: #1195139
Catch InstanceIsLocked exception on server actions

In v3, if the server is locked, a 409 error is raised, and the error msg
is like "the server is locked". In v2 now, the 409 error is raised too. But the
error msg is like "Instance is in an invalid state for \'pause(action name)\'".
The error msg is inappropriate, two points:
1. the state is valid for pause
2. the message doesn't tell that the instance is locked

The patch fixes the ploblem, and will do as v3. See the v3 commit:
2c9fca6a3c916f3f594ddbb1a8ee8946b8ea3ac7

Change-Id: I76572e37af686a4af35c31a3ea27f7070894b88a
Closes-Bug: #1255386
Update help for osapi_compute_listen_port

This patch cleans up the configuration help for the
osapi_compute_listen_port option.

Change-Id: Ib253fc542637aee3bcdcc4c5f7330a3be490a5a9
Fix Neutron Authentication for Metadata Service

A recent change to the way Nova creates a Neutron client
51e5f52e4cb60e266ccde71f205c91eb8c97b48b changed the conditions
under which it re-authenticates using the neutron admin credentials
from "if admin" to "if admin or context.is_admin".  However this
meant that any user with admin role in Nova interacted with Neutron
as a different tenant, preventing them from non-admin actions such
as allocating floating IPS.

This was then addressed by 1c1371c78b990447aeaa4377b512f8887e6ff3ce
which only reauthenticated as admin on the explicit use of
"admin=True" parameter to neutonv2.get_client().

However the metadata service does not explicitly create the neutron
client so it has to pass in a context created by
context.get_admin_context() which has is_admin=True but no auth_token.

This change therefore accepts this combination of context values
as a valid reason to re-authenticate as admin, while still allowing
users with the admin role to use their own token.

As a tidy up two tests for getting an admin client are moved from
TestNeutonClient to join the other admin client tests in
TestNeutronClientForAdminScenarios

Change-Id: Ic2a6f383a85f6bb606d8d65feaefa0d23329adb9
Closes-Bug:  1255577
Remove last of AssertEquals

Change-Id: I2f130e10c387bd8828ef35d5dce16fbf87557c3b
Correct network_device_mtu help string

This patch corrects the network_device_mtu help string. This setting
changes the mtu size for the interface not the vlan.

Change-Id: I2f3bcac42f08b70eb1649e3085c0de9af27b350c
Closes-bug: #1256696
Merge "Remove last of AssertEquals"
Merge "VMware: enable driver to work with postgres database"
Merge "Fix testcase config option imports"
Merge "Update help for osapi_compute_listen_port"