diff options
author | Johannes Kulik <johannes.kulik@sap.com> | 2021-04-16 12:45:40 +0200 |
---|---|---|
committer | Johannes Kulik <johannes.kulik@sap.com> | 2021-04-19 11:35:54 +0200 |
commit | 0997ad15fcaff33443d31d1dc26516b3aed8a802 (patch) | |
tree | 648e5257178ee20b587dfbf1f87d1c5f492ea3e0 /nova/virt/vmwareapi/vm_util.py | |
parent | cf4b152b6b9ec137b49d903aa0f4ccc821a087cc (diff) | |
download | nova-0997ad15fcaff33443d31d1dc26516b3aed8a802.tar.gz |
vmware: Use oslo.vmware's get_moref_value()
With switching the SOAP library backing oslo.vmware [1], the internal
representation of ManagedObjectReference's attributes changes. To be able
to make the switch without interruption, we introduced helper functions
in oslo.vmware. This commit uses one of those - get_moref_value()
- to make the access to the "value" attribute compatible with both
backing libraries.
Bump oslo.vmware lower-constraint to a version containing the helper
function. We bump one version higher, because we already merged a patch
(I3c769d3499f906b33725171a57313c8ae35b6a1d) that uses the cookiejar
access contained in that version.
[1] https://specs.openstack.org/openstack/oslo-specs/specs/victoria/oslo-vmware-soap-library-switch.html
Change-Id: I48841a777aaa2e515c141857099c16483ab619e0
Diffstat (limited to 'nova/virt/vmwareapi/vm_util.py')
-rw-r--r-- | nova/virt/vmwareapi/vm_util.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/nova/virt/vmwareapi/vm_util.py b/nova/virt/vmwareapi/vm_util.py index 1baed66197..2deb9a6c0c 100644 --- a/nova/virt/vmwareapi/vm_util.py +++ b/nova/virt/vmwareapi/vm_util.py @@ -1623,15 +1623,18 @@ def create_folder(session, parent_folder_ref, name): """ LOG.debug("Creating folder: %(name)s. Parent ref: %(parent)s.", - {'name': name, 'parent': parent_folder_ref.value}) + {'name': name, + 'parent': vutil.get_moref_value(parent_folder_ref)}) try: folder = session._call_method(session.vim, "CreateFolder", parent_folder_ref, name=name) LOG.info("Created folder: %(name)s in parent %(parent)s.", - {'name': name, 'parent': parent_folder_ref.value}) + {'name': name, + 'parent': vutil.get_moref_value(parent_folder_ref)}) except vexc.DuplicateName as e: LOG.debug("Folder already exists: %(name)s. Parent ref: %(parent)s.", - {'name': name, 'parent': parent_folder_ref.value}) + {'name': name, + 'parent': vutil.get_moref_value(parent_folder_ref)}) val = e.details['object'] folder = vutil.get_moref(val, 'Folder') return folder |