Box actions now use I18n
This commit is contained in:
parent
1d29ba31fa
commit
367a51fae8
|
@ -10,7 +10,7 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
env.ui.info "Deleting box directory..."
|
env.ui.info "vagrant.actions.box.destroy.destroying", :name => env["box"].name
|
||||||
FileUtils.rm_rf(env["box"].directory)
|
FileUtils.rm_rf(env["box"].directory)
|
||||||
|
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
|
@ -30,7 +30,7 @@ module Vagrant
|
||||||
def instantiate_downloader
|
def instantiate_downloader
|
||||||
@env["download.classes"].each do |klass|
|
@env["download.classes"].each do |klass|
|
||||||
if klass.match?(@env["box"].uri)
|
if klass.match?(@env["box"].uri)
|
||||||
@env.ui.info "Downloading with #{klass}..."
|
@env.ui.info "vagrant.actions.box.download.with", :class => klass.to_s
|
||||||
@downloader = klass.new(@env)
|
@downloader = klass.new(@env)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -53,13 +53,12 @@ module Vagrant
|
||||||
|
|
||||||
def recover(env)
|
def recover(env)
|
||||||
if temp_path && File.exist?(temp_path)
|
if temp_path && File.exist?(temp_path)
|
||||||
env.ui.info "Cleaning up downloaded box..."
|
env.ui.info "vagrant.actions.box.download.cleaning"
|
||||||
File.unlink(temp_path)
|
File.unlink(temp_path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_tempfile
|
def with_tempfile
|
||||||
@env.ui.info "Creating tempfile for storing box file..."
|
|
||||||
File.open(box_temp_path, Platform.tar_file_options) do |tempfile|
|
File.open(box_temp_path, Platform.tar_file_options) do |tempfile|
|
||||||
yield tempfile
|
yield tempfile
|
||||||
end
|
end
|
||||||
|
@ -70,7 +69,7 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
def download_to(f)
|
def download_to(f)
|
||||||
@env.ui.info "Copying box to temporary location..."
|
@env.ui.info "vagrant.actions.box.download.copying"
|
||||||
@downloader.download!(@env["box"].uri, f)
|
@downloader.download!(@env["box"].uri, f)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -49,7 +49,7 @@ module Vagrant
|
||||||
|
|
||||||
def decompress
|
def decompress
|
||||||
Dir.chdir(@env["box"].directory) do
|
Dir.chdir(@env["box"].directory) do
|
||||||
@env.ui.info "Extracting box to #{@env["box"].directory}..."
|
@env.ui.info "vagrant.actions.box.unpackage.extracting"
|
||||||
Archive::Tar::Minitar.unpack(@env["download.temp_path"], @env["box"].directory)
|
Archive::Tar::Minitar.unpack(@env["download.temp_path"], @env["box"].directory)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,7 +9,7 @@ module Vagrant
|
||||||
|
|
||||||
def call(env)
|
def call(env)
|
||||||
begin
|
begin
|
||||||
env.ui.info "Verifying box..."
|
env.ui.info "vagrant.actions.box.verify.verifying"
|
||||||
VirtualBox::Appliance.new(env["box"].ovf_file)
|
VirtualBox::Appliance.new(env["box"].ovf_file)
|
||||||
rescue Exception
|
rescue Exception
|
||||||
return env.error!(:box_verification_failed)
|
return env.error!(:box_verification_failed)
|
||||||
|
|
|
@ -163,3 +163,15 @@ en:
|
||||||
setup_unison: Creating unison crontab entries...
|
setup_unison: Creating unison crontab entries...
|
||||||
suspend:
|
suspend:
|
||||||
suspending: Saving VM state and suspending execution...
|
suspending: Saving VM state and suspending execution...
|
||||||
|
|
||||||
|
box:
|
||||||
|
destroy:
|
||||||
|
destroying: Deleting box '%{name}'...
|
||||||
|
download:
|
||||||
|
with: Downloading with %{class}...
|
||||||
|
cleaning: Cleaning up downloaded box...
|
||||||
|
copying: Copying box to temporary location...
|
||||||
|
unpackage:
|
||||||
|
extracting: Extracting box...
|
||||||
|
verify:
|
||||||
|
verifying: Verifying box...
|
||||||
|
|
Loading…
Reference in New Issue