From d5e02ac11b850dd21960bf9edbb0af878b4e997e Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Mon, 20 Feb 2017 15:37:49 +0100 Subject: [PATCH] Sle 12 sp2 casp bnc 1022784 (#527) * release download: break downloading if the host/proxy cannot be resolved --- .travis.yml | 2 +- package/yast2-installation.changes | 7 +++++++ package/yast2-installation.spec | 2 +- .../clients/inst_download_release_notes.rb | 13 ++++++++----- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52bd4957d..5c992e00d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: - sudo apt-get install libaugeas-dev libxml2-dev # end of augeas install - wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh - - sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2-core-dev yast2 yast2-network yast2-transfer yast2-users yast2-country libaugeas-dev" -g "rspec:3.3.0 yast-rake gettext rubocop:0.41.2 simplecov:0.12.0 coveralls:0.8.19 cheetah abstract_method cfa" + - sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2-core-dev yast2 yast2-network yast2-transfer yast2-users yast2-country libaugeas-dev" -g "rspec:3.3.0 yast-rake gettext rubocop:0.41.2 coveralls:0.8.19 cheetah abstract_method cfa" script: - rake check:syntax - rake check:pot diff --git a/package/yast2-installation.changes b/package/yast2-installation.changes index ec4ba051d..53f7d6dde 100644 --- a/package/yast2-installation.changes +++ b/package/yast2-installation.changes @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Feb 20 13:28:28 CET 2017 - schubi@suse.de + +- Downloading release notes: Do not try again if the host or the + proxy cannot be resolved (bnc#1022784) +- 3.1.217.25 + +------------------------------------------------------------------- Tue Feb 14 13:24:33 CET 2017 - schubi@suse.de - CaaSP AY: Adapted requirements of yast2-services-manager. diff --git a/package/yast2-installation.spec b/package/yast2-installation.spec index 73e701a39..8251ae0cb 100644 --- a/package/yast2-installation.spec +++ b/package/yast2-installation.spec @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.1.217.24 +Version: 3.1.217.25 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/lib/installation/clients/inst_download_release_notes.rb b/src/lib/installation/clients/inst_download_release_notes.rb index dc3c6910f..5d5f36778 100644 --- a/src/lib/installation/clients/inst_download_release_notes.rb +++ b/src/lib/installation/clients/inst_download_release_notes.rb @@ -31,9 +31,12 @@ class InstDownloadReleaseNotesClient < Client # When cURL returns one of those codes, the download won't be retried # @see man curl - # 7 = Failed to connect to host. - # 28 = Operation timeout. - CURL_GIVE_UP_RETURN_CODES = [7, 28].freeze + CURL_GIVE_UP_RETURN_CODES = { + 5 => "Couldn't resolve proxy.", + 6 => "Couldn't resolve host.", + 7 => "Failed to connect to host.", + 28 => "Operation timeout." + }.freeze # Download all release notes mentioned in Product::relnotesurl_all # @@ -123,8 +126,8 @@ def download_release_notes InstData.release_notes[product["short_name"]] = SCR.Read(path(".target.string"), filename) InstData.downloaded_release_notes << product["short_name"] break - elsif CURL_GIVE_UP_RETURN_CODES.include?(ret) - log.info "Communication with server for release notes download failed, skipping further attempts." + elsif CURL_GIVE_UP_RETURN_CODES.key? ret + log.info "Communication with server for release notes download failed ( #{CURL_GIVE_UP_RETURN_CODES[ret]} ), skipping further attempts." InstData.stop_relnotes_download = true break else