--provider on box add supports any format of that provider
This commit is contained in:
parent
4b299c9fc2
commit
a786bb53d0
|
@ -18,6 +18,8 @@ IMPROVEMENTS:
|
|||
- Vagrant will show an error if VirtualBox 4.2.14 is running.
|
||||
- Added provider to BoxNotFound error message. [GH-1692]
|
||||
- If Ansible fails to run properly, show an error message. [GH-1699]
|
||||
- Adding a box with the `--provider` flag will now allow a box for
|
||||
any of that provider's supported formats.
|
||||
|
||||
BUG FIXES:
|
||||
|
||||
|
|
|
@ -44,12 +44,23 @@ module Vagrant
|
|||
return
|
||||
end
|
||||
|
||||
box_formats = env[:box_provider]
|
||||
if box_formats
|
||||
# Determine the formats a box can support and allow the box to
|
||||
# be any of those formats.
|
||||
provider_plugin = Vagrant.plugin("2").manager.providers[env[:box_provider]]
|
||||
if provider_plugin
|
||||
box_formats = provider_plugin[1][:box_format]
|
||||
box_formats ||= env[:box_provider]
|
||||
end
|
||||
end
|
||||
|
||||
# Add the box
|
||||
env[:ui].info I18n.t("vagrant.actions.box.add.adding", :name => env[:box_name])
|
||||
added_box = nil
|
||||
begin
|
||||
added_box = env[:box_collection].add(
|
||||
@temp_path, env[:box_name], env[:box_provider], env[:box_force])
|
||||
@temp_path, env[:box_name], box_formats, env[:box_force])
|
||||
rescue Vagrant::Errors::BoxUpgradeRequired
|
||||
# Upgrade the box
|
||||
env[:box_collection].upgrade(env[:box_name])
|
||||
|
|
Loading…
Reference in New Issue