summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-05-24 13:57:11 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-05-24 13:58:43 -0700
commit11dd0513120b444a3950345a68383bb41a2e6398 (patch)
tree77afb2f6c3f716c2b98f2677a526cd6c8ede7f8f
parent277231271eabc1570923a477dc51a9332900170a (diff)
downloadchef-11dd0513120b444a3950345a68383bb41a2e6398.tar.gz
Use Shellwords.join in shell_out
be a bit less lazy. but ultimately train's run_command should take *args Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/mixin/shell_out.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index d888dc3457..967b4e97e3 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -17,6 +17,7 @@
require "mixlib/shellout" unless defined?(Mixlib::ShellOut)
require_relative "path_sanity"
+require "shellwords" unless defined?(Shellwords)
class Chef
module Mixin
@@ -159,7 +160,7 @@ class Chef
def self.shell_out_command(*args, **options)
if Chef::Config.target_mode?
- FakeShellOut.new(args, options, transport_connection.run_command(args.join(" "))) # FIXME FIXME FIXME: join here is horrible
+ FakeShellOut.new(args, options, transport_connection.run_command(Shellwords.join(" "))) # FIXME: train should accept run_command(*args)
else
cmd = if options.empty?
Mixlib::ShellOut.new(*args)