Switch to Oslo-Incubator's EnvFilter rootwrap

Nova-Network used to have its own class for DnsMasq rootwrap
filtering. This was generalized into a new EnvFilter rootwrap
filter that can specify both commands and environments to pass.

Update to openstack.common.rootwrap to git a117358 of
oslo-incubator's rootwrap. This includes the following commits
merged from oslo:

    3b16d31 Remove DnsmasqFilter and DeprecatedDnsmasqFilter
    f9d1a59 Handle empty arglists in Filters
    233baa2 Handle empty PATH environment variable
    3e74c00 Add IpFilter, IPNetnsExecFilter and EnvFilter
    8b95b1e Handle relative path arguments in Killfilter
    7119e29 Enable hacking H404 test.
    ea78eec Update KillFilter to stop at '\0' for readlink() function.

Related to: blueprint quantum-common-rootwrap

Change-Id: I125e5724259850dc4768fb236cbfa5df199008c0
Remove old legacy network info model in libvirt driver

Update libvirt driver, virt firewall and hypervisor unit tests to
use nova.network.model instead of legacy "network,mapping" tuple.

Partly implement blueprint nova-network-legacy

Co-author: Amir Sadoughi<amir.sadoughi@gmail.com>
Change-Id: I4d38bb81a4f64efdb78f5da52fbbb382981e0b96
Improve performance of driver's get_available_nodes

get_available_nodes() is called every time an instance is updated.  That
ends up calling get_host_stats(refresh=True), resulting in a
libvirt/XenAPI/etc call.  On a build of a new instance when the instance
record is updated often (task_state and progress), this results in a lot
of unnecessary driver calls.

This changes get_available_nodes() to take a refresh kwarg to pass
through to get_host_stats(), defaulting to False so that it uses
the cache.  Places that used get_available_nodes() and are sensitive to
stale data are changed to add refresh=True.  Also adds a helper driver
method for 'is_node_available'.  And make sure that even if drivers'
get_host_stats() methods get refresh=False that they refresh when they
have no stats.

Fixes bug 1210264

Change-Id: I22c8d70e3e70f2d2421915da66c2618688e0db2b
Clean up unimplemented methods in the powervm driver

There were several methods overridden from the base virt driver class in
the powervm driver but all they did was pass which can cause problems
with tempest, e.g. the tempest test for pausing an instance will timeout
waiting for the instance state to change. This change raises
NotImplementedError rather than passes so that tempest will fail out
quickly when testing something that the powervm driver does not
implement.

Also removes the overridden manage_image_cache method since it didn't do
anything, which is exactly what the base class does.

Added unit tests to make sure that methods which should simply pass do
and that tests which should raise NotImplementedError do that also.

Fixes bug 1205066

Change-Id: Ieaf256a5c0f54804686318d6cbd5877a5003c9eb
libvirt: sync get_available_resources and get_host_stats

get_available_resources is actually used by the scheduler while
get_host_stats was previously used, and is still used for host
capabilities.  This patch makes get_available_resources and
get_host_stats use the same logic to clean up the code. As part of
making them use the same logic, some of the unused data returned from
get_host_stats is changed to be what get_available_resources expects.
This is also in preparation for removing the periodic RPC fanout from
compute nodes to the scheduler.

This patch cleans up libvirt and fake drivers only.  This is not needed
for other virt backends as this is a cleanup only.  Further cleanup of
libvirt and other drivers will happen after get_host_stats isn't used
for the compute fanout to schedulers.

Because this makes a change to the fake driver, several api samples
needed to be changed as well. The fake driver is changed so the
test_virt_driver tests can continue to be used

Part of bp no-compute-fanout-to-scheduler

Change-Id: I1eec5c117a1cb0490e9f9c09e731909bc31698a9
Add supported_instances to get_available_resource to all virt drivers

Add 'supported_instances' to the function get_available_resource for all
virt drivers (except libvirt which is done separately). This will help
make image_props_filter work without the RPC broadcast capabilities.

Part of bp no-compute-fanout-to-scheduler

Change-Id: If9eee203b3cbb12963dc55e4215d206cb5d81264
db: Add host_ip and supported_instances to compute_nodes

In order to remove compute capabilities being broadcast via RPC to the
schedulers, host_ip and supported_instances, the two pieces of data the
scheduler uses that aren't in the database today, need to be added.
In the scope of this blueprint, only the way the filters are getting
their data is changed, not how the data is generated or anything else.

host_ip is used by the affinity_filter and supported_instances is used
by image_props_filter.

Part of bp no-compute-fanout-to-scheduler

Change-Id: I72371260159c9fdffcdb57209095fc103b6dd79e
Make affinity_filters use host_ip from DB not RPC

Instead of using host_ip from capabilities, which are being removed, get the
host_ip from the same place the rest of scheduling information comes
from, the database.

Part of bp no-compute-fanout-to-scheduler

Change-Id: I56a1cbb1903c20b347469d0ee5a8c6d89a21c44e
Make compute_capabilities_filter use information from DB not RPC

Make compute_capabilities_filter directly use the data in host_state and
not the data capabilities data that is currently broadcast from the
schedulers over RPC, as this will be removed since it doesn't scale.

The filter name, compute_capabilities_filter, is kept the same to keep
backwards compatibility.

Once all the capabilities usage in scheduler filters is removed, the
capabilities RPC broadcast can be removed.

Part of bp no-compute-fanout-to-scheduler.

Change-Id: I846259b363a794803e230eaf25c69c52970b6c4f
Fix bad check for openstack versions (vendor_data/config drive)

Looks like the lack of a test case sneaked in this bug. Added a
simple one that just ensures that we can get a list of all the
metadata information. Basic issue was that the check_version
was checking against ec2 versions. Changed it to check OpenStack
version including the 'latest'.

Fixes bug #1211122

Change-Id: Ifac7659467b81abcffd3f84a24292c11f2e058fc
Merge "Switch to Oslo-Incubator's EnvFilter rootwrap"
remove _action_change_password the attribute in V3 server API

There is no implementation of _action_change_password for the
attribute of ActionDeserializer in V3 server API. Get rid of it

fix bug 1209072

Change-Id: I37019811caa71c491c228b99babfcfb34bbaa685
Fix typo in exception message

fixes bug 1212438

Change-Id: Ib563fc10743600284a385fcbda1967c85182f542
Sync gettextutils from oslo-incubator

Partially implements bp user-locale-api

Change-Id: I1a053d9d0ad65ca90cac86196da68900b8fe112d
Merge "libvirt: sync get_available_resources and get_host_stats"
Merge "Fix bad check for openstack versions (vendor_data/config drive)"
Merge "Add supported_instances to get_available_resource to all virt drivers"
Enforce compute:update policy in API

Now that compute/api.py:update() is no longer being called for instance
updates the policy check is no longer enforced.  This adds policy
checking back in at the API level so that the compute:update policy will
continue to function as it did before.

Bug 1212807

Change-Id: I365ad8ac2845d914deefb841c314a50f4869dba0
Merge "db: Add host_ip and supported_instances to compute_nodes"
Merge "Make affinity_filters use host_ip from DB not RPC"