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

Make Proc Directory Injectable #1132

Closed
dagrooms52 opened this issue Sep 25, 2017 · 3 comments
Closed

Make Proc Directory Injectable #1132

dagrooms52 opened this issue Sep 25, 2017 · 3 comments

Comments

@dagrooms52
Copy link

I'm writing a Docker container for a plugin service that will be able to read the resource stats from the Docker host. In the container, I have to pass the host's proc directory as /host/proc instead of slapping it over the container's /proc. This requirement renders this library useless for reading the host's proc info, since it assumes where proc is located on a linux machine. If I could inject the read path into your utility, I wouldn't have to write a custom parser for this project.

Either a setting like psutil.proc_path = "/host/proc" or an object with the path initializer, util = PsUtil("/host/proc") would be awesome to have.

@giampaolo
Copy link
Owner

The functionality you're talking about is already there:

import psutil
psutil.PROCFS_PATH = "/foo"

@dagrooms52
Copy link
Author

Awesome - sorry about this issue, didn't read the whole docs and that was at the bottom of the page.

@giampaolo
Copy link
Owner

giampaolo commented Sep 25, 2017 via email

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

No branches or pull requests

2 participants