Make hypervisor_version an int in fakeVirt driver

This is a follow up to 9e770e62135fe9c2c8ac0121a5a79245b25a7847, which
missed the change in a duplicate copy of host_status.

Add regression test to test_virt_drivers.

This requires changes to the API samples, because they were wrong. virt
drivers use convert_version_to_int which converts a version string to a
4 digit number ("1.0" becomes to 1000)

Change-Id: I28ce23509e3c9feae183a49a8fc5bf3c7c601295
Closes-Bug: #1285035
VM in rescue state must have a restricted set of actions

Right now it is possible to pause, suspend and stop a VM in state RESCUED,
so after the state is changed, it's not possible to trigger unrescue anymore
since the original state is lost.

This patch remove vm_states.RESCUED as valid state from stop,
pause and suspend actions.

The vm_states devref is also updated to reflect this change including the
current reboot flow.( vm_states.RESCUED cannot be rebooted as per
today code)

DocImpact
Closes-Bug: #1319182
Co-Authored-By: Cyril Roelandt <cyril.roelandt@enovance.com>
Change-Id: I531dea5a5499bf93c24bea37850d562134dee281
VMware: remove unused parameter 'network_info'

The parameter 'network_info' is not used for destroying an instance and
doesn't need to be passed through the whole stack.

Change-Id: I0a8b912ff7693478917e849e17093d1541adeeeb
Libvirt: Added suffix to configdrive_path required for rescue

It was observed that during nova rescue, nova failed to create
a rescue disk for disk.config. The reason being that .rescue
suffix was missing from the configdrive path. It was working
till Havana but the functionality broke in Icehouse. This commit
fixes the suffix problem.

Unittests have been added to verify following scenarios:
    1. Make sure that .rescue disks are created when not using
        config drive
    2. Make sure that .rescue disks are created when using
        config drive

Closes-Bug: #1334024

Change-Id: I87449ffddd047cb84b7b881757ea4c29927b95da
Fix virt BDM __setattr__ and __getattr__

Previously we would only allow these to work on fields that are found in
the _proxy_as_attr collection of the object and we would unconditionally
raise an AttributeError otherwise.

This behaviour is too restrictive as it prevents us from using mock on
these objects properly, Instead we now delegate back to the parent
class for a more natural behaviour.

Change-Id: I5c221eef8f05c66ac2e2fb4abf645748407462c0
libvirt: Support IPv6 with LXC

Libvirt's LXC implementation exposes a read-only  `/proc/sys/net` to the
guests. This causes some of the guest's default network configuration scripts
to fail.

This patch works-around the issue by using `post-up` hooks to configure IPv6.

Closes-Bug: 1340791

Change-Id: I805cad98d855fcb2c90b07e98ad3653d1620bd42
Update requirements to include decorator>=3.4.0

This third party package is used but there was no specific
requirement for it.

Change-Id: I50fcc7a1c4029b36e02e75eaf27df7ca791aef4e
Xen: Cleanup orphan volume connections on boot failure

If the boot process fails after the VDI creation but before a VBD is
created then the current cleanup methods will not work as they all rely
on lookups via VBD.

Change-Id: Id0d93ee60f75bf319baf7859b220ca325175128a
Closes-bug: #1329941
Enable live migration unit test use instance object

test_post_live_migration_no_shared_storage_working_correctly is
still using instance dict, we should change it to using instance
object.

Related to blueprint compute-manager-objects-juno

Change-Id: I7709b32ebeef88eb9759d0275c3076091b6be669
VMware: support the hotplug of a neutron port

Nova already has support for hotplugging neutorn ports in the libvirt
driver. This extends the support to the VMware driver.

Implements the blueprint vmware-hot-plug

Change-Id: I01b78621016e20c8e61d48bdeeac166f08f799be
VMware: Remove unnecessary deepcopy()s in test_configdrive

test_configdrive was doing a deepcopy of its test_instance object in
some tests. This was unnecessary, as the object is created fresh in
setUp().

Also, change a couple of dict lookups of test_instance to object
properties.

Change-Id: I3a5039fde9f8fba5285d90b28743b7af8cd1a168
libvirt: remove unused list_instance_ids method

All code has been converted to use list_instance_domains so the
list_instance_ids method can finally be removed.

Blueprint: libvirt-domain-listing-speedup
Change-Id: I9ce33cda5608796e0eec4ec0804ee179a4704d9d
Fix Cells ImagePropertiesFilter can raise exceptions

In a misconfigured scenario the ImagePropertiesFilter can raise an
exception which causes the image to be unbuildable in the region. This
happens when the capabilities is set for prominent_hypervisor_version
to an empty list.

Change-Id: I17bd9d87fa69ad34b19591018543a34dfd050978
Closes-Bug: 1343462
Minor tweaks to hypervisor_version to int

Follow up to I28ce23509e3c9feae183a49a8fc5bf3c7c601295. That path had a
few minor issues that weren't worth holding up the patch for. This patch
fixes those issues.

Change-Id: I878cb028e1dc48ad5182820d580fab609ba62db4
Cleanup: remove unused argument

The vm_util.get_values_from_object_properties(...) method in the VMware
driver takes an unused param 'properties'.

This patch cleans up the method signature.

Change-Id: Iba738c2b49f829c1c0e17973b5265e88741fade7
Remove stubs in favor of mock in test_policy

This patch converts tests_policy to use mock instead of stubs. I was
stealing some tests from nova to another openstack project and made this
change there so I figured nova would benefit from it too.

Change-Id: I6d086795c559ac8f04028d820e8e88bfd5305426
Cleanup and gate on hacking E711 and E712 rule

Fix the offending instances of the rule
and removes it from the ignore list in tox.ini
so that we can gate on E711 and E712 rules.

Most violations were in DB queries. Replace as follows:
  False -> sqlalchemy.sql.false()
  None  -> sqlalchemy.sql.null()
  True  -> sqlalchemy.sql.true()

Change-Id: Id84aa04697d1b3c23dc03195113e296c6715379d
Removes useless stub of glanceclient create

There was a stub out of glanceclient.create that was being called from a
couple unit test setUp()'s, but the stub method stubs out something that
is overridden by the stub_out_glance() fake method.

Change-Id: I300f6ccc999958c33a2dd729cb8bde89bed63967
Imported Translations from Transifex

Change-Id: I7686f34f321ed13c8806f680763f1876d615c88d
Add APIv2 support to make host optional on evacuate

In the event of an unrecoverable hardware failure, support needs to
relocate an instance to another compute so it can be rebuilt.

The changes involved in this patch are:
  [*] Add a new v2 extension to determine that the host argument
      on evacuate is now optional.(Extended_evacuate_find_host)
  [*] Doc regeneration.

DocImpact: The evacuate target host is now optional.
If 'host' field is not sent in the request, the scheduler will
determine the target host.
This will include nova client changes ( on the proper commit ) to support
this new optional parameter.

Implements: blueprint find-host-and-evacuate-instance

Change-Id: Ib34fb3120263b746ad2f8fe89c14137e36a07a53
Co-Authored-By: Juan M. Olle <juan.m.olle@intel.com>
Co-Authored-By: Andres Buraschi <andres.buraschi@intel.com>
Co-Authored-By: Anuj Mathur <anujm@thoughtworks.com>
Co-Authored-By: Navneet Kumar <navneetk@thoughtworks.com>
Co-Authored-By: Claxton Correya <claxton@gmail.com>