Updated openstack/openstack
Project: openstack/nova  82c4e8cd30158db420b97b3d3f6d18d354e43bf6

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