Merge branch 'client-certs' of https://github.com/sthulb/vagrant into sthulb-client-certs

Conflicts:
	config/default.rb
	lib/vagrant/action/builtin/handle_box_url.rb
	plugins/commands/box/command/add.rb
This commit is contained in:
Mitchell Hashimoto 2013-11-25 16:50:11 -08:00
commit 13b52f6b6e
5 changed files with 14 additions and 2 deletions

View File

@ -32,6 +32,7 @@ module Vagrant
downloader_options[:continue] = true downloader_options[:continue] = true
downloader_options[:insecure] = env[:box_download_insecure] downloader_options[:insecure] = env[:box_download_insecure]
downloader_options[:ui] = env[:ui] downloader_options[:ui] = env[:ui]
downloader_options[:client_cert] = env[:box_client_cert]
# If the temporary path exists, verify it is not too old. If its # If the temporary path exists, verify it is not too old. If its
# too old, delete it first because the data may have changed. # too old, delete it first because the data may have changed.

View File

@ -38,6 +38,7 @@ module Vagrant
# raise a terrible runtime error. # raise a terrible runtime error.
box_name = env[:machine].config.vm.box box_name = env[:machine].config.vm.box
box_url = env[:machine].config.vm.box_url box_url = env[:machine].config.vm.box_url
box_download_client_cert = env[:machine].config.vm.box_download_client_cert
box_download_insecure = env[:machine].config.vm.box_download_insecure box_download_insecure = env[:machine].config.vm.box_download_insecure
lock.synchronize do lock.synchronize do
@ -61,10 +62,11 @@ module Vagrant
begin begin
env[:action_runner].run(Vagrant::Action.action_box_add, { env[:action_runner].run(Vagrant::Action.action_box_add, {
:box_client_cert => box_download_client_cert,
:box_download_insecure => box_download_insecure, :box_download_insecure => box_download_insecure,
:box_name => box_name, :box_name => box_name,
:box_provider => box_formats, :box_provider => box_formats,
:box_url => box_url :box_url => box_url,
}) })
rescue Errors::BoxAlreadyExists rescue Errors::BoxAlreadyExists
# Just ignore this, since it means the next part will succeed! # Just ignore this, since it means the next part will succeed!

View File

@ -23,6 +23,7 @@ module Vagrant
@continue = options[:continue] @continue = options[:continue]
@insecure = options[:insecure] @insecure = options[:insecure]
@ui = options[:ui] @ui = options[:ui]
@client_cert = options[:client_cert]
end end
# This executes the actual download, downloading the source file # This executes the actual download, downloading the source file
@ -43,6 +44,7 @@ module Vagrant
options += ["--continue-at", "-"] if @continue options += ["--continue-at", "-"] if @continue
options << "--insecure" if @insecure options << "--insecure" if @insecure
options << "--cert" << @client_cert if @client_cert
options << @source options << @source
# Specify some options for the subprocess # Specify some options for the subprocess

View File

@ -23,6 +23,11 @@ module VagrantPlugins
options[:insecure] = i options[:insecure] = i
end end
o.on("--cert certfile", String,
"The client SSL cert") do |c|
options[:client_cert] = c
end
o.on("--provider provider", String, o.on("--provider provider", String,
"The provider that backs the box.") do |p| "The provider that backs the box.") do |p|
options[:provider] = p options[:provider] = p
@ -44,7 +49,8 @@ module VagrantPlugins
:box_url => argv[1], :box_url => argv[1],
:box_clean => options[:clean], :box_clean => options[:clean],
:box_force => options[:force], :box_force => options[:force],
:box_download_insecure => options[:insecure] :box_download_client_cert => options[:client_cert],
:box_download_insecure => options[:insecure],
}) })
# Success, exit status 0 # Success, exit status 0

View File

@ -17,6 +17,7 @@ module VagrantPlugins
attr_accessor :base_mac attr_accessor :base_mac
attr_accessor :boot_timeout attr_accessor :boot_timeout
attr_accessor :box attr_accessor :box
attr_accessor :client_cert
attr_accessor :box_url attr_accessor :box_url
attr_accessor :box_download_insecure attr_accessor :box_download_insecure
attr_accessor :graceful_halt_timeout attr_accessor :graceful_halt_timeout