Skip to content

Commit a4c6e9a

Browse files
committed
Adding a connect_timeout option for downloading java.
1 parent 82a284c commit a4c6e9a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

providers/ark.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def oracle_downloaded?(download_path, new_resource)
5454
require 'digest'
5555
if new_resource.checksum =~ /^[0-9a-f]{32}$/
5656
downloaded_sha = Digest::MD5.file(download_path).hexdigest
57-
downloaded_sha == new_resource.md5
57+
downloaded_sha == new_resource.md5
5858
else
5959
downloaded_sha = Digest::SHA256.file(download_path).hexdigest
6060
downloaded_sha == new_resource.checksum
@@ -78,7 +78,7 @@ def download_direct_from_oracle(tarball_name, new_resource)
7878
converge_by(description) do
7979
Chef::Log.debug "downloading oracle tarball straight from the source"
8080
cmd = shell_out!(
81-
%Q[ curl --create-dirs -L --retry #{new_resource.retries} --retry-delay #{new_resource.retry_delay} --cookie "#{cookie}" #{new_resource.url} -o #{download_path} ]
81+
%Q[ curl --create-dirs -L --retry #{new_resource.retries} --retry-delay #{new_resource.retry_delay} --cookie "#{cookie}" #{new_resource.url} -o #{download_path} --connect-timeout #{new_resource.connect_timeout} ]
8282
)
8383
end
8484
else

resources/ark.rb

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
attribute :alternatives_priority, :kind_of => Integer, :default => 1
4343
attribute :retries, :kind_of => Integer, :default => 0
4444
attribute :retry_delay, :kind_of => Integer, :default => 2
45+
attribute :connect_timeout, :kind_of => Integer, :default => 600 # => 10 minutes
4546

4647
# we have to set default for the supports attribute
4748
# in initializer since it is a 'reserved' attribute name

0 commit comments

Comments
 (0)