diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-02-01 18:41:41 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-02-01 18:41:41 -0800 |
commit | 1a081d5f7f91299013a5d6946d7a1f6892be7ece (patch) | |
tree | 084e50356909a1c3916226c2708a2dc401f4c5fe /lib/mixlib/shellout.rb | |
parent | e901532bb36a6750f0ce46bafb268262b3352df9 (diff) | |
download | mixlib-shellout-lcg/cleanup2.tar.gz |
spec cleanup and some light refactoringlcg/cleanup2
- mostly cleans up the windows specs so its easier to read the API
out of them and removes some of the very brittle internal testing
- refactors the 'which' logic a bit. trying to converge towards the
chef/chef version and eventually extracting common code so that
do not have to maintain 10+ slightly different copies everywhere.
- adds the Mixlib::ShellOut::EmptyWindowsCommand exception because
letting CreateProcessW throw a generic SystemCallError is pretty
much useless to everyone.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/mixlib/shellout.rb')
-rw-r--r-- | lib/mixlib/shellout.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/mixlib/shellout.rb b/lib/mixlib/shellout.rb index 3f1106f..c9f2fa1 100644 --- a/lib/mixlib/shellout.rb +++ b/lib/mixlib/shellout.rb @@ -253,7 +253,7 @@ module Mixlib # within +timeout+ seconds (default: 600s) def run_command if logger - log_message = (log_tag.nil? ? "" : "#@log_tag ") << "sh(#@command)" + log_message = (log_tag.nil? ? "" : "#{@log_tag} ") << "sh(#{@command})" logger.send(log_level, log_message) end super @@ -290,9 +290,9 @@ module Mixlib end def inspect - "<#{self.class.name}##{object_id}: command: '#@command' process_status: #{@status.inspect} " + + "<#{self.class.name}##{object_id}: command: '#{@command}' process_status: #{@status.inspect} " + "stdout: '#{stdout.strip}' stderr: '#{stderr.strip}' child_pid: #{@child_pid.inspect} " + - "environment: #{@environment.inspect} timeout: #{timeout} user: #@user group: #@group working_dir: #@cwd >" + "environment: #{@environment.inspect} timeout: #{timeout} user: #{@user} group: #{@group} working_dir: #{@cwd} >" end private |