core: do proper type conversions for box checksum types
This commit is contained in:
parent
f48f2ff072
commit
72edddbb09
|
@ -19,8 +19,8 @@ module Vagrant
|
|||
@download_interrupted = false
|
||||
|
||||
# Determine the checksum type to use
|
||||
checksum = env[:box_checksum] || ""
|
||||
checksum_klass = case env[:box_checksum_type]
|
||||
checksum = (env[:box_checksum] || "").to_s
|
||||
checksum_klass = case env[:box_checksum_type].to_sym
|
||||
when nil
|
||||
nil
|
||||
when :md5
|
||||
|
|
|
@ -16,7 +16,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
o.on("--checksum-type VALUE", String, "Checksum type") do |c|
|
||||
options[:checksum_type] = c
|
||||
options[:checksum_type] = c.to_sym
|
||||
end
|
||||
|
||||
o.on("-c", "--clean", "Remove old temporary download if it exists.") do |c|
|
||||
|
|
|
@ -270,6 +270,10 @@ module VagrantPlugins
|
|||
@hostname = nil if @hostname == UNSET_VALUE
|
||||
@hostname = @hostname.to_s if @hostname
|
||||
|
||||
if @box_download_checksum_type
|
||||
@box_download_checksum_type = @box_download_checksum_type.to_sym
|
||||
end
|
||||
|
||||
# Make sure the box URL is an array if it is set
|
||||
if @box_url && !@box_url.is_a?(Array)
|
||||
@box_url = [@box_url]
|
||||
|
|
Loading…
Reference in New Issue