Skip to content

Commit

Permalink
Merge pull request #205 from jsrain/master
Browse files Browse the repository at this point in the history
better time-out handling for relnotes download
  • Loading branch information
jsrain committed May 16, 2014
2 parents cf86cbb + 0098d1d commit f8303d8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri May 16 12:19:30 UTC 2014 - jsrain@suse.cz

- reduced time-out for downloading release notes when behind
firewall (bnc#878265)
- 3.1.84

-------------------------------------------------------------------
Fri May 16 08:37:23 UTC 2014 - mvidner@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-installation
Version: 3.1.83
Version: 3.1.84
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
10 changes: 9 additions & 1 deletion src/clients/inst_download_release_notes.rb
Expand Up @@ -78,6 +78,10 @@ def download_release_notes
}
log.info("Products: #{products}")
products.each do | product |
if InstData.stop_relnotes_download
log.info("Skipping release notes download due to previous download issues")
break
end
if InstData.downloaded_release_notes.include? product["name"]
log.info("Release notes for #{product['name']} already downloaded, skipping...")
next
Expand Down Expand Up @@ -105,7 +109,7 @@ def download_release_notes
SCR.Read(path(".target.tmpdir")))
# download release notes now
cmd = Builtins.sformat(
"/usr/bin/curl --location --verbose --fail --max-time 300 %1 '%2' --output '%3' > '%4/%5' 2>&1",
"/usr/bin/curl --location --verbose --fail --max-time 300 --connect-timeout 15 %1 '%2' --output '%3' > '%4/%5' 2>&1",
proxy,
url,
String.Quote(filename),
Expand All @@ -119,6 +123,10 @@ def download_release_notes
InstData.release_notes[product["name"]] = SCR.Read(path(".target.string"), filename)
InstData.downloaded_release_notes << product["name"]
break
elsif ret == 7
log.info "Communication with server for release notes download failed, skipping further attempts."
InstData.stop_relnotes_download = true
break
end
end
end
Expand Down
5 changes: 5 additions & 0 deletions src/modules/InstData.rb
Expand Up @@ -100,6 +100,10 @@ def main
# only product names, not the actual RN text
@downloaded_release_notes = []

# remember that downloading release notes failed due to communication
# issues with the server, avoid further attempts then
@stop_relnotes_download = false

# EOF
end

Expand All @@ -119,6 +123,7 @@ def main
publish :variable => :image_target_disk, :type => "string"
publish :variable => :release_notes, :type => "map<string,string>"
publish :variable => :downloaded_release_notes, :type => "list<string>"
publish :variable => :stop_relnotes_download, :type => "boolean"
end

InstData = InstDataClass.new
Expand Down

0 comments on commit f8303d8

Please sign in to comment.