core: better messaging around box add not existing [GH-4414]
This commit is contained in:
parent
4138179207
commit
8cd2e58194
|
@ -197,17 +197,17 @@ module Vagrant
|
|||
metadata_version = metadata.version(
|
||||
version || ">= 0", provider: provider)
|
||||
if !metadata_version
|
||||
if !provider
|
||||
if provider && !metadata.version(">= 0", provider: provider)
|
||||
raise Errors::BoxAddNoMatchingProvider,
|
||||
name: metadata.name,
|
||||
requested: provider,
|
||||
url: url
|
||||
else
|
||||
raise Errors::BoxAddNoMatchingVersion,
|
||||
constraints: version || ">= 0",
|
||||
name: metadata.name,
|
||||
url: url,
|
||||
versions: metadata.versions.join(", ")
|
||||
else
|
||||
raise Errors::BoxAddNoMatchingProvider,
|
||||
name: metadata.name,
|
||||
requested: provider,
|
||||
url: url
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -351,7 +351,8 @@ en:
|
|||
box_add_no_matching_version: |-
|
||||
The box you're attempting to add has no available version that
|
||||
matches the constraints you requested. Please double-check your
|
||||
settings.
|
||||
settings. Also verify that if you specified version constraints,
|
||||
that the provider you wish to use is available for these constriants.
|
||||
|
||||
Box: %{name}
|
||||
Address: %{url}
|
||||
|
|
Loading…
Reference in New Issue