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

Update gopsutil to stop calling SetEnv #3041

Merged
merged 3 commits into from
Aug 21, 2017
Merged

Conversation

schmichael
Copy link
Member

@schmichael schmichael commented Aug 16, 2017

Pulls in shirou/gopsutil#417

Fixes #3036

@schmichael schmichael changed the title Update gopsutil to stop calling SetEnv [WIP] Update gopsutil to stop calling SetEnv Aug 16, 2017
}
sysctl, err := exec.LookPath("/sbin/sysctl")
if err != nil {
return []string{}, err
}
out, err := exec.Command(sysctl, "-n", mib).Output()
cmd := exec.Command(sysctl, "-n", mib)
cmd.Env = hostEnv
Copy link

Choose a reason for hiding this comment

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

Since you're setting the execution environment for just the sysctl call, wouldn't it be easier to just always override with LC_ALL=C? The locale change has limited scope and should not affect Nomad executor. In fact, the original code was done to avoid any possible locale-induced parsing problem, so LC_ALL=C is a desirable thing.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I understand what you're trying to say. This change sets LC_ALL=C just for this subprocess that needs it instead of setting it globally and having unintentional side effects.

Copy link

Choose a reason for hiding this comment

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

right you are.

@schmichael schmichael changed the title [WIP] Update gopsutil to stop calling SetEnv Update gopsutil to stop calling SetEnv Aug 17, 2017
@dadgar dadgar merged commit d5982d5 into master Aug 21, 2017
@dadgar dadgar deleted the b-3036-update-gopsutil branch August 21, 2017 17:42
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants