Catch and handle customization errors
This commit is contained in:
parent
e1d0ce19ce
commit
a3395f94ab
|
@ -18,7 +18,13 @@ module Vagrant
|
|||
arg
|
||||
end
|
||||
|
||||
env[:vm].driver.execute_command(processed_command)
|
||||
result = env[:vm].driver.execute_command(processed_command)
|
||||
if result.exit_code != 0
|
||||
raise Errors::VMCustomizationFailed, {
|
||||
:command => processed_command.inspect,
|
||||
:error => result.stderr
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ module Vagrant
|
|||
|
||||
# Executes a raw command.
|
||||
def execute_command(command)
|
||||
execute(*command)
|
||||
raw(*command)
|
||||
end
|
||||
|
||||
# Forwards a set of ports for a VM.
|
||||
|
|
|
@ -334,6 +334,11 @@ module Vagrant
|
|||
error_key(:no_base_mac, "vagrant.actions.vm.match_mac")
|
||||
end
|
||||
|
||||
class VMCustomizationFailed < VagrantError
|
||||
status_code(61)
|
||||
error_key(:failure, "vagrant.actions.vm.customize")
|
||||
end
|
||||
|
||||
class VMFailedToBoot < VagrantError
|
||||
status_code(21)
|
||||
error_key(:failed_to_boot, "vagrant.actions.vm.boot")
|
||||
|
|
|
@ -313,6 +313,16 @@ en:
|
|||
clear_shared_folders:
|
||||
deleting: Cleaning previously set shared folders...
|
||||
customize:
|
||||
failure: |-
|
||||
A customization command failed:
|
||||
|
||||
%{command}
|
||||
|
||||
The following error was experienced:
|
||||
|
||||
%{error}
|
||||
|
||||
Please fix this customization and try again.
|
||||
running: Running any VM customizations...
|
||||
destroy:
|
||||
destroying: Destroying VM and associated drives...
|
||||
|
|
Loading…
Reference in New Issue