From 17184e7d56f24793c7dfd8f2385f5c727e6b839b Mon Sep 17 00:00:00 2001 From: Johannes Kulik Date: Thu, 3 Sep 2020 10:43:48 +0200 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: I3c769d3499f906b33725171a57313c8ae35b6a1d --- nova/tests/unit/virt/vmwareapi/fake.py | 7 +------ nova/virt/vmwareapi/vmops.py | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/nova/tests/unit/virt/vmwareapi/fake.py b/nova/tests/unit/virt/vmwareapi/fake.py index c6d8f30473f1..a57ddcebeb6e 100644 --- a/nova/tests/unit/virt/vmwareapi/fake.py +++ b/nova/tests/unit/virt/vmwareapi/fake.py @@ -1225,12 +1225,7 @@ class FakeVim(object): self.client = FakeClient() self.client.factory = FakeFactory() - transport = DataObject() - transport.cookiejar = "Fake-CookieJar" - options = DataObject() - options.transport = transport - - self.client.options = options + self.client.cookiejar = "Fake-CookieJar" service_content = self.client.factory.create('ns0:ServiceContent') service_content.propertyCollector = "PropCollector" diff --git a/nova/virt/vmwareapi/vmops.py b/nova/virt/vmwareapi/vmops.py index f030c1a3ac9f..0a09ecc70b77 100644 --- a/nova/virt/vmwareapi/vmops.py +++ b/nova/virt/vmwareapi/vmops.py @@ -212,7 +212,7 @@ class VMwareVMOps(object): datastore, injected_files, admin_password, network_info): session_vim = self._session.vim - cookies = session_vim.client.options.transport.cookiejar + cookies = session_vim.client.cookiejar dc_path = vutil.get_inventory_path(session_vim, dc_info.ref) uploaded_iso_path = self._create_config_drive(context, instance, @@ -415,7 +415,7 @@ class VMwareVMOps(object): dc_path = vutil.get_inventory_path(session.vim, vi.dc_info.ref) host = self._session._host - cookies = session.vim.client.options.transport.cookiejar + cookies = session.vim.client.cookiejar images.fetch_image( context,