commands/box/repackage: better error if box not found
This commit is contained in:
parent
05018363d6
commit
00962c7c2a
|
@ -192,6 +192,10 @@ module Vagrant
|
||||||
error_key(:box_not_found_with_provider)
|
error_key(:box_not_found_with_provider)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class BoxNotFoundWithProviderAndVersion < VagrantError
|
||||||
|
error_key(:box_not_found_with_provider_and_version)
|
||||||
|
end
|
||||||
|
|
||||||
class BoxProviderDoesntMatch < VagrantError
|
class BoxProviderDoesntMatch < VagrantError
|
||||||
error_key(:box_provider_doesnt_match)
|
error_key(:box_provider_doesnt_match)
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,9 +23,10 @@ module VagrantPlugins
|
||||||
# Verify the box exists that we want to repackage
|
# Verify the box exists that we want to repackage
|
||||||
box = @env.boxes.find(box_name, box_provider, "= #{box_version}")
|
box = @env.boxes.find(box_name, box_provider, "= #{box_version}")
|
||||||
if !box
|
if !box
|
||||||
raise Vagrant::Errors::BoxNotFound,
|
raise Vagrant::Errors::BoxNotFoundWithProviderAndVersion,
|
||||||
:name => box_name,
|
name: box_name,
|
||||||
:provider => box_provider
|
provider: box_provider.to_s,
|
||||||
|
version: box_version
|
||||||
end
|
end
|
||||||
|
|
||||||
# Repackage the box
|
# Repackage the box
|
||||||
|
|
|
@ -443,6 +443,10 @@ en:
|
||||||
the box are shown below:
|
the box are shown below:
|
||||||
|
|
||||||
%{providers}
|
%{providers}
|
||||||
|
box_not_found_with_provider_and_version: |-
|
||||||
|
The box '%{name}' (v%{version}) with provider '%{provider}'
|
||||||
|
could not be found. Please double check and try again. You
|
||||||
|
can see all the boxes that are installed with `vagrant box list`.
|
||||||
box_provider_doesnt_match: |-
|
box_provider_doesnt_match: |-
|
||||||
The box you attempted to add doesn't match the provider you specified.
|
The box you attempted to add doesn't match the provider you specified.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue