Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy.deepcopy() fails when using a SessionOrientedStub #1093

Open
alexshpilkin opened this issue Nov 4, 2024 · 0 comments
Open

copy.deepcopy() fails when using a SessionOrientedStub #1093

alexshpilkin opened this issue Nov 4, 2024 · 0 comments
Labels

Comments

@alexshpilkin
Copy link

alexshpilkin commented Nov 4, 2024

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('[email protected]', '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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant