Treat an empty box value as invalid
This fixes an issue where having a box name set to an empty string will cause all Vagrant commands to fail with an error like: ArgumentError: Malformed version number string (random box name) This may be related to #10663.
This commit is contained in:
parent
6ee180a023
commit
352b955d09
@ -511,7 +511,7 @@ module VagrantPlugins
|
||||
@base_mac = nil if @base_mac == UNSET_VALUE
|
||||
@base_address = nil if @base_address == UNSET_VALUE
|
||||
@boot_timeout = 300 if @boot_timeout == UNSET_VALUE
|
||||
@box = nil if @box == UNSET_VALUE
|
||||
@box = nil if @box == UNSET_VALUE || @box.to_s.empty?
|
||||
@ignore_box_vagrantfile = false if @ignore_box_vagrantfile == UNSET_VALUE
|
||||
|
||||
if @box_check_update == UNSET_VALUE
|
||||
|
||||
@ -86,6 +86,12 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
|
||||
assert_invalid
|
||||
end
|
||||
|
||||
it "cannot be an empty string" do
|
||||
subject.box = ""
|
||||
subject.finalize!
|
||||
assert_invalid
|
||||
end
|
||||
|
||||
it "is not required if the provider says so" do
|
||||
machine.provider_options[:box_optional] = true
|
||||
subject.box = nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user