vmware: Use cookiejar from oslo.vmware client directly

With changing the SOAP library backing oslo.vmware [1], the cookiejar of
a session must be accessed differently. Therefore, oslo.vmware
introduced a property on the client to abstract this change away. This
commit uses the new place to access the attribute.

[1] https://specs.openstack.org/openstack/oslo-specs/specs/victoria/oslo-vmware-soap-library-switch.html

Change-Id: I0e308b4798e2c632c79f60f91abca697bd91687d
This commit is contained in:
Mike Durnosvystov 2021-04-28 07:54:39 +00:00 committed by Mike
parent 4baa502ec8
commit 985a49bec1
2 changed files with 2 additions and 2 deletions

View File

@ -261,7 +261,7 @@ class VmdkConnector(initiator_connector.InitiatorConnector):
with open(tmp_file_path, "rb") as tmp_file:
dc_name = session.invoke_api(
vim_util, 'get_object_property', session.vim, dc_ref, 'name')
cookies = session.vim.client.options.transport.cookiejar
cookies = session.vim.client.cookiejar
cacerts = self._ca_file if self._ca_file else not self._insecure
self._upload_vmdk(
tmp_file, self._ip, self._port, dc_name, dstore.name, cookies,

View File

@ -270,7 +270,7 @@ class VmdkConnectorTestCase(test_connector.ConnectorTestCase):
exp_rel_path = '%s/foo.vmdk' % tmp_folder_path
upload_vmdk.assert_called_once_with(
tmp_file, self._connector._ip, self._connector._port, dc_name,
ds_name, session.vim.client.options.transport.cookiejar,
ds_name, session.vim.client.cookiejar,
exp_rel_path, units.Gi, self._connector._ca_file,
self._connector._timeout)