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

Context support with Tests #508

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

hartsock
Copy link
Member

Here's a branch with nested Python Context support. I found this helpful in designing larger projects where I did not want to leave dangling sessions on the vSphere/vCenter/ESXi host that could constitute a memory leak.

Includes tests fixtures for Context support in pyVmomi. Also accounts for nested and reused contexts in a single python script. Additional work checks session keys on the server to make sure orphaned sessions do not hang around and cause a memory leak.
return


def open(host='localhost', port=443, user='root', pwd='',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems open and close functions are similar as Connect/Disconnect in connect.py beside SetSi(). I wonder if it's better to add these two methods in connect.py so we could reuse the existing logic?

@jeking3
Copy link
Contributor

jeking3 commented Dec 19, 2018

This has been open for almost two years. It should be moved forward or closed.

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

Successfully merging this pull request may close these issues.

4 participants