core: fix exception when checksum type is nil
Thanks @johnbellone
This commit is contained in:
parent
e83070371d
commit
0a43cf2b6f
|
@ -21,18 +21,19 @@ module Vagrant
|
||||||
|
|
||||||
# Determine the checksum type to use
|
# Determine the checksum type to use
|
||||||
checksum = (env[:box_checksum] || "").to_s
|
checksum = (env[:box_checksum] || "").to_s
|
||||||
checksum_klass = case env[:box_checksum_type].to_sym
|
checksum_klass = nil
|
||||||
when nil
|
if env[:box_checksum_type]
|
||||||
nil
|
checksum_klass = case env[:box_checksum_type].to_sym
|
||||||
when :md5
|
when :md5
|
||||||
Digest::MD5
|
Digest::MD5
|
||||||
when :sha1
|
when :sha1
|
||||||
Digest::SHA1
|
Digest::SHA1
|
||||||
when :sha256
|
when :sha256
|
||||||
Digest::SHA2
|
Digest::SHA2
|
||||||
else
|
else
|
||||||
raise Errors::BoxChecksumInvalidType,
|
raise Errors::BoxChecksumInvalidType,
|
||||||
type: env[:box_checksum_type].to_s
|
type: env[:box_checksum_type].to_s
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Go through each URL and attempt to download it
|
# Go through each URL and attempt to download it
|
||||||
|
|
Loading…
Reference in New Issue