Error and exit if SSH command returns non-zero exit status [closes GH-80]
This commit is contained in:
parent
f30cdf3eea
commit
8ea9816552
|
@ -150,6 +150,10 @@ module Vagrant
|
|||
# implementation also reports `:exit_status` to the block if given.
|
||||
def exec!(command, &block)
|
||||
block ||= Proc.new do |ch, type, data|
|
||||
if type == :exit_status && data != 0
|
||||
raise ActionException.new(:ssh_bad_exit_status, :command => command)
|
||||
end
|
||||
|
||||
ch[:result] ||= ""
|
||||
ch[:result] << data if [:stdout, :stderr].include?(type)
|
||||
end
|
||||
|
|
|
@ -134,6 +134,11 @@
|
|||
permissions on the following file to 0600 and then try running this command again:
|
||||
|
||||
<%= key_path %>
|
||||
:ssh_bad_exit_status: |-
|
||||
The following SSH command responded with a non-zero exit status.
|
||||
Vagrant assumes that this means the command failed!
|
||||
|
||||
<%= command %>
|
||||
:ssh_unavailable_windows: |-
|
||||
`vagrant ssh` isn't available on the Windows platform. The
|
||||
vagrant.ppk file is available at
|
||||
|
|
Loading…
Reference in New Issue