Describe the bug
Attempting to use copy.deepcopy() fails when using a pyVim.connect.VimSessionOrientedStub, while (since the fix introduced in a90023f) it works correctly for the bare pyVmomi.SoapStubAdapter.
Reproduction steps
>>> import copy, pyVim.connect, pyVmomi
>>> stub = pyVim.connect.VimSessionOrientedStub(
... pyVim.connect.SmartStubAdapter(host='vcenter.example', disableSslCertValidation=True),
... pyVim.connect.VimSessionOrientedStub.makeUserLoginMethod('administrator@vsphere.local', 'swordfish'))
>>> copy.deepcopy(pyVmomi.vim.ServiceInstance('ServiceInstance', stub.soapStub))
'vim.ServiceInstance:ServiceInstance'
>>> copy.deepcopy(pyVmomi.vim.ServiceInstance('ServiceInstance', stub))
[...]
TypeError: cannot pickle '_thread.lock' object
Expected behavior
copy.deepcopy() should work equally well for SoapStubAdapters and VimSessionOrientedStubs.
Additional context
Tested on 8.0.2.0.1, but I see no relevant code changes since then.
Describe the bug
Attempting to use
copy.deepcopy()fails when using apyVim.connect.VimSessionOrientedStub, while (since the fix introduced in a90023f) it works correctly for the barepyVmomi.SoapStubAdapter.Reproduction steps
Expected behavior
copy.deepcopy()should work equally well forSoapStubAdapters andVimSessionOrientedStubs.Additional context
Tested on 8.0.2.0.1, but I see no relevant code changes since then.