Skip to content

Commit d8b698c

Browse files
committed
add retry attributes to java_ark lwrp
1 parent cfd599d commit d8b698c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

providers/ark.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 --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} ]
8282
)
8383
end
8484
else
@@ -123,6 +123,8 @@ def download_direct_from_oracle(tarball_name, new_resource)
123123
r = remote_file "#{Chef::Config[:file_cache_path]}/#{tarball_name}" do
124124
source new_resource.url
125125
checksum new_resource.checksum
126+
retries new_resource.retries
127+
retry_delay new_resource.retry_delay
126128
mode 0755
127129
action :nothing
128130
end

resources/ark.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
attribute :owner, :default => "root"
4141
attribute :default, :equal_to => [true, false], :default => true
4242
attribute :alternatives_priority, :kind_of => Integer, :default => 1
43+
attribute :retries, :kind_of => Integer, :default => 0
44+
attribute :retry_delay, :kind_of => Integer, :default => 2
4345

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

0 commit comments

Comments
 (0)