Initial work commands/up: make sure all names to with_target_vms are strings providers/docker: create a docker host VM if needed providers/docker: executor abstraction for driver to eventually support remote providers/docker: vagrant executor providers/docker: support creating the machine providers/docker: status works if host VM is gone providers/docker: use start fence to get real docker output core: Call preserves stack ordering core: support Message post option providers/docker: Guard some features with HasSSH checks providers/docker: much better messaging around create/destroy providers/docker: output the container ID on create providers/docker: copy the hostmachine Vagrantfile to the data dir providers/docker: should make host machine before any up action providers/docker: HandleBox before the host machine providers/virtualbox: functional_vboxsf to disable vboxsf providers/virtualbox: synced folder usable method should take 2 args providers/docker: default machine name to :default
34 lines
1.0 KiB
Ruby
34 lines
1.0 KiB
Ruby
require "vagrant/util/busy"
|
|
require "vagrant/util/subprocess"
|
|
|
|
module VagrantPlugins
|
|
module DockerProvider
|
|
module Executor
|
|
# The Local executor executes a Docker client that is running
|
|
# locally.
|
|
class Local
|
|
def execute(*cmd, &block)
|
|
# Append in the options for subprocess
|
|
cmd << { :notify => [:stdout, :stderr] }
|
|
|
|
interrupted = false
|
|
int_callback = ->{ interrupted = true }
|
|
result = Vagrant::Util::Busy.busy(int_callback) do
|
|
Vagrant::Util::Subprocess.execute(*cmd, &block)
|
|
end
|
|
|
|
if result.exit_code != 0 && !interrupted
|
|
msg = result.stdout.gsub("\r\n", "\n")
|
|
msg << result.stderr.gsub("\r\n", "\n")
|
|
raise "#{cmd.inspect}\n#{msg}" #Errors::ExecuteError, :command => command.inspect
|
|
end
|
|
|
|
# Return the output, making sure to replace any Windows-style
|
|
# newlines with Unix-style.
|
|
result.stdout.gsub("\r\n", "\n")
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|