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

Migrate to the chef-utils helpers for which/shell_out #1501

Merged
merged 11 commits into from
Aug 26, 2020

Conversation

lamont-granquist
Copy link
Contributor

@lamont-granquist lamont-granquist commented Aug 21, 2020

This replaces the which/shell_out helpers with ones from chef-utils.

This moves the helpers to mixin/shell_out and mixin/which to better mirror chef's usage. It leaves aliases in the old locations. I don't see anything outside of the plugin DSL which references those so don't think it'd be breaking to remove them entirely, at the same time it is exceptionally cheap to leave the aliased constants in for backcompat.

There's a few changes here which may be user visible:

  • we're including the ruby bindir in the default path now
  • we're forcing the language and encoding to english/utf-8
  • we're now getting live_stream to STDOUT for >= debug logging out of shell_out

This replaces the which/shell_out helpers with ones from chef-utils.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@lamont-granquist lamont-granquist requested review from a team as code owners August 21, 2020 23:32
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
The default paths algorithm is a little bit weird

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@lamont-granquist
Copy link
Contributor Author

there's some test failures around the silly PATH mangling, i'll have to fix them later...

lib/ohai/mixin/which.rb Outdated Show resolved Hide resolved
@tas50 tas50 changed the title Migrate to the chef-utils helpers Migrate to the chef-utils helpers for which/shell_out Aug 22, 2020
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
we need to call out to the ChefConfig helper to set this

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
This throws warnings, but I'm a bit out of ideas today.

This lies like crazy to make it work on windows.

Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
@tas50 tas50 merged commit 49668f8 into master Aug 26, 2020
@tas50 tas50 deleted the lcg/chef-utils-helpers branch December 16, 2020 01:05
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

Successfully merging this pull request may close these issues.

2 participants