Fix shell provisioner to run with new machine abstraction
This commit is contained in:
parent
a238e06795
commit
ed1bc58735
|
@ -76,11 +76,12 @@ module VagrantPlugins
|
||||||
command = "chmod +x #{config.upload_path} && #{config.upload_path}#{args}"
|
command = "chmod +x #{config.upload_path} && #{config.upload_path}#{args}"
|
||||||
|
|
||||||
with_script_file do |path|
|
with_script_file do |path|
|
||||||
# Upload the script to the VM
|
# Upload the script to the machine
|
||||||
env[:vm].channel.upload(path.to_s, config.upload_path)
|
env[:machine].communicate.tap do |comm|
|
||||||
|
comm.upload(path.to_s, config.upload_path)
|
||||||
|
|
||||||
# Execute it with sudo
|
# Execute it with sudo
|
||||||
env[:vm].channel.sudo(command) do |type, data|
|
comm.sudo(command) do |type, data|
|
||||||
if [:stderr, :stdout].include?(type)
|
if [:stderr, :stdout].include?(type)
|
||||||
# Output the data with the proper color based on the stream.
|
# Output the data with the proper color based on the stream.
|
||||||
color = type == :stdout ? :green : :red
|
color = type == :stdout ? :green : :red
|
||||||
|
@ -95,3 +96,4 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue