From 985a49bec12a2c8b04761cd563741fba2273184a Mon Sep 17 00:00:00 2001 From: Mike Durnosvystov Date: Wed, 28 Apr 2021 07:54:39 +0000 Subject: [PATCH] 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 --- os_brick/initiator/connectors/vmware.py | 2 +- os_brick/tests/initiator/connectors/test_vmware.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/os_brick/initiator/connectors/vmware.py b/os_brick/initiator/connectors/vmware.py index f5be794ce..a026a4d70 100644 --- a/os_brick/initiator/connectors/vmware.py +++ b/os_brick/initiator/connectors/vmware.py @@ -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, diff --git a/os_brick/tests/initiator/connectors/test_vmware.py b/os_brick/tests/initiator/connectors/test_vmware.py index 6f7a980dc..a9ec8f18f 100644 --- a/os_brick/tests/initiator/connectors/test_vmware.py +++ b/os_brick/tests/initiator/connectors/test_vmware.py @@ -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)