We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[1] pry(main)> require 'chef/mixin/shell_out' => true [2] pry(main)> include Chef::Mixin::ShellOut => Object [3] pry(main)> shell_out("lskdjflskj 'foo'") => <Mixlib::ShellOut#70318079326640: command: 'lskdjflskj 'foo'' process_status: #<Process::Status: pid 4874 exit 127> stdout: '' stderr: 'sh: lskdjflskj: command not found' child_pid: 4874 environment: {"LC_ALL"=>"en_US.UTF-8", "LANGUAGE"=>"en_US.UTF-8", "LANG"=>"en_US.UTF-8", "PATH"=>"/Users/lamont/.rvm/gems/ruby-2.5.1/bin:/Users/lamont/.rvm/gems/ruby-2.5.1@global/bin:/Users/lamont/.rvm/rubies/ruby-2.5.1/bin:/opt/chefdk/bin:/Users/lamont/.chefdk/gem/ruby/2.5.0/bin:/opt/chefdk/embedded/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/lamont/bin:/usr/local/sbin:/opt/chefdk/gitbin:/Users/lamont/.rvm/bin"} timeout: 600 user: group: working_dir: > [4] pry(main)> shell_out("lskdjflskj") Errno::ENOENT: No such file or directory - lskdjflskj from /Users/lamont/.rvm/gems/ruby-2.5.1/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout/unix.rb:340:in `exec'
The second case should probably catch Errno::ENOENT and remap it onto the same error message you get from calling error!:
Errno::ENOENT
error!
[5] pry(main)> shell_out("lskdjflskj 'foo'").error! Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '127' ---- Begin output of lskdjflskj 'foo' ---- STDOUT: STDERR: sh: lskdjflskj: command not found ---- End output of lskdjflskj 'foo' ---- Ran lskdjflskj 'foo' returned 127 from /Users/lamont/.rvm/gems/ruby-2.5.1/gems/mixlib-shellout-2.3.2/lib/mixlib/shellout.rb:293:in `invalid!'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The second case should probably catch
Errno::ENOENT
and remap it onto the same error message you get from callingerror!
:The text was updated successfully, but these errors were encountered: