Skip to content

Context support with Tests#508

Closed
hartsock wants to merge 3 commits intovmware:masterfrom
hartsock:context
Closed

Context support with Tests#508
hartsock wants to merge 3 commits intovmware:masterfrom
hartsock:context

Conversation

@hartsock
Copy link
Copy Markdown
Contributor

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.

hartsocks added 3 commits February 6, 2017 14:08
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.
Comment thread pyVim/context.py
return


def open(host='localhost', port=443, user='root', pwd='',
Copy link
Copy Markdown
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
Copy Markdown
Contributor

jeking3 commented Dec 19, 2018

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

@hartsock
Copy link
Copy Markdown
Contributor Author

hartsock commented Mar 5, 2026

Closing — this PR is over 8 years old and the project has moved on. Thank you for the original review feedback.

@hartsock hartsock closed this Mar 5, 2026
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