Merge "Add a policy for handling retrospective vetos"
Merge "instance_topology_from_instance handles request_spec properly"
Merge "Don't truncate osapi_glance_link or osapi_compute_link prefixes"
Merge "Check requirements.txt files for missing (used) requirements"
Merge "Add sqlite dev packages to devref env setup doc"
Merge "Sync oslo-incubator module log:"
Merge "Bump FakeDriver's resource numbers"
Merge "Remove stale code from ObjectListBase"
Merge "Catch NotImplementedError on reset_network for xen"
Merge "Console: warn that the Nova VMRC console driver will be deprecated in K"
Fix DB migration 254 by adding missing unittest

By merging https://review.openstack.org/#/c/114286/23, a new db migration
was added but the unittest was missing.

Change-Id: I32e2455fd5efb2aad52d9a4d7666783c0e613e75
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
libvirt: avoid need for lockutils setup running test cases

Some of the firewall/driver test cases rely on lockutils being
setup, so running tests directly fails:

 $ .venv/bin/python -m testtools.run nova.tests.virt.libvirt
 ...snip...
    Traceback (most recent call last):
      File "nova/tests/virt/libvirt/test_driver.py", line 10182, in test_multinic_iptables
        self.fw.prepare_instance_filter(instance_ref, network_info)
      File "nova/virt/firewall.py", line 184, in prepare_instance_filter
        self.refresh_provider_fw_rules()
      File "nova/virt/firewall.py", line 474, in refresh_provider_fw_rules
        self._do_refresh_provider_fw_rules()
      File "nova/openstack/common/lockutils.py", line 267, in inner
        with lock(name, lock_file_prefix, external, lock_path):
      File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
        return self.gen.next()
      File "nova/openstack/common/lockutils.py", line 231, in lock
        ext_lock = external_lock(name, lock_file_prefix, lock_path)
      File "nova/openstack/common/lockutils.py", line 180, in external_lock
        lock_file_path = _get_lock_path(name, lock_file_prefix, lock_path)
      File "nova/openstack/common/lockutils.py", line 171, in _get_lock_path
        raise cfg.RequiredOptError('lock_path')
    RequiredOptError: value required for option: lock_path

The first workaround is to launch using (which run_tests.sh does)

 $ python -m nova.openstack.common.lockutils

but it is nicer to developers if we just avoid the need for using
external lock files during the test suite execution entirely. This
can be done by mocking the 'external_lock' method to use a transient
semaphore instead of external lock file on disk.

Closes-bug: #1369973
Change-Id: I3dcdf6353986ff35c7237644f467ee7e98423f76
libvirt: remove pointless class in util test suite

The test_utils.py module had two separate test classes defined
for no real benefit. This is left over from merging tests from
two separate files together.

Change-Id: I808719955f90f7333aecbb9f3a1e19a377553edf
libvirt: convert test_vif.py to avoid DB usage

Remove use of the flavour APIs in the VIF test case avoiding
the need to hit the database. This allows conversion to the
NoDBTestCase which speeds up execution from 3 seconds to 0.3
seconds.

Partial-bug: #1369516
Change-Id: Ib0239b0f943baa1b1d81478b3b0d1e2ce1fb8722
libvirt: convert test_blockinfo.py to avoid DB usage

Remove use of the flavour/instance DB access in the blockinfo
test case by using the Instance object instead. This speeds up
execution from approx 3 seconds to 0.3 seconds.

Partial-bug: #1369516
Change-Id: Ibb76ae64edf48012c3eddfe2eb656aa58bd198b1
libvirt: convert test_dmcrypt to avoid DB usage

Nothing in the dmcrypt test case uses the DB, so it was
incurring the DB setup penalty for no gain. Switch to
use NoDBTestCase reducing time from 1.7s to 0.09s

Partial-bug: #1369516
Change-Id: Ifd4b919f60f48f691d83cedb6ce7ea18c98636ad
libvirt: convert encrypted LVM test to avoid DB usage

The EncryptedLvmTestCase test case was depending on the DB setup
for no purpose. This masked a bug whereby the test was relying
on the implicit import of nova.keymgr.conf_key_mgr config opts.
Explicitly import the config opt and remove DB setup. This
improves performance from 1.8s to 0.6s

Partial-bug: #1369516
Change-Id: Icd5c27b3ac6cab5a014fae65904bbbefb5343282
Merge "Add more information to generic _add_floating_ip exception message"
Merge "Remove unused oslo.config import"