core: fix crash for missing options [GH-5550]
This commit is contained in:
parent
e64cef9d31
commit
e759df11a0
|
@ -48,6 +48,7 @@ BUG FIXES:
|
||||||
- core: do not report plugins as installed when plugins are disabled [GH-5698, GH-5430]
|
- core: do not report plugins as installed when plugins are disabled [GH-5698, GH-5430]
|
||||||
- core: Only take files when packaging a box to avoid duplicates [GH-5658, GH-5657]
|
- core: Only take files when packaging a box to avoid duplicates [GH-5658, GH-5657]
|
||||||
- core: escape curl urls and authentication [GH-5677]
|
- core: escape curl urls and authentication [GH-5677]
|
||||||
|
- core: fix crash if a value is missing for CLI arguments [GH-5550]
|
||||||
- core/cli: fix box checksum validation [GH-4665, GH-5221]
|
- core/cli: fix box checksum validation [GH-4665, GH-5221]
|
||||||
- core/windows: allow Windows UNC paths to allow more than 256
|
- core/windows: allow Windows UNC paths to allow more than 256
|
||||||
characters [GH-4815]
|
characters [GH-4815]
|
||||||
|
|
|
@ -58,7 +58,7 @@ module Vagrant
|
||||||
|
|
||||||
opts.parse!(argv)
|
opts.parse!(argv)
|
||||||
return argv
|
return argv
|
||||||
rescue OptionParser::InvalidOption
|
rescue OptionParser::InvalidOption, OptionParser::MissingArgument
|
||||||
raise Errors::CLIInvalidOptions, help: opts.help.chomp
|
raise Errors::CLIInvalidOptions, help: opts.help.chomp
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,17 @@ describe Vagrant::Plugin::V2::Command do
|
||||||
expect { instance.parse_options(OptionParser.new) }.
|
expect { instance.parse_options(OptionParser.new) }.
|
||||||
to raise_error(Vagrant::Errors::CLIInvalidOptions)
|
to raise_error(Vagrant::Errors::CLIInvalidOptions)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "raises an error if options without a value are given" do
|
||||||
|
opts = OptionParser.new do |o|
|
||||||
|
o.on("--provision-with x,y,z", Array, "Example") { |f| }
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
instance = klass.new(["--provision-with"], nil)
|
||||||
|
expect { instance.parse_options(opts) }.
|
||||||
|
to raise_error(Vagrant::Errors::CLIInvalidOptions)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "target VMs" do
|
describe "target VMs" do
|
||||||
|
|
|
@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
||||||
s.required_rubygems_version = ">= 1.3.6"
|
s.required_rubygems_version = ">= 1.3.6"
|
||||||
s.rubyforge_project = "vagrant"
|
s.rubyforge_project = "vagrant"
|
||||||
|
|
||||||
s.add_dependency "bundler", ">= 1.5.2", "< 1.8.0"
|
s.add_dependency "bundler", ">= 1.5.2", "<= 1.9.4"
|
||||||
s.add_dependency "childprocess", "~> 0.5.0"
|
s.add_dependency "childprocess", "~> 0.5.0"
|
||||||
s.add_dependency "erubis", "~> 2.7.0"
|
s.add_dependency "erubis", "~> 2.7.0"
|
||||||
s.add_dependency "i18n", ">= 0.6.0", "<= 0.8.0"
|
s.add_dependency "i18n", ">= 0.6.0", "<= 0.8.0"
|
||||||
|
|
Loading…
Reference in New Issue