lib/rspec-system/node_set/vagrant.rb in rspec-system-0.3.2 vs lib/rspec-system/node_set/vagrant.rb in rspec-system-0.3.3
- old
+ new
@@ -51,13 +51,13 @@
dest = opts[:n].name
cmd = opts[:c]
r = nil
Dir.chdir(@vagrant_path) do
- cmd = "vagrant ssh #{dest} --command \"cd /tmp && sudo #{cmd}\""
- log.debug("[vagrant#run] Running command: #{cmd}")
- r = systemu cmd
- log.debug("[Vagrant#run] Finished running command: #{cmd}.")
+ ex = "vagrant ssh #{dest} --command \"cd /tmp && sudo sh -c '#{cmd}'\""
+ log.debug("[vagrant#run] Running command: #{ex}")
+ r = systemu ex
+ log.debug("[Vagrant#run] Finished running command: #{ex}.")
end
{
:exit_code => r[0].exitstatus,
:stdout => r[1],