Hello community, here is the log from the commit of package yast2-registration for openSUSE:Factory checked in at 2018-03-07 10:29:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old) and /work/SRC/openSUSE:Factory/.yast2-registration.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-registration" Wed Mar 7 10:29:31 2018 rev:12 rq:582606 version:4.0.23 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes 2018-02-24 16:36:07.980460100 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-registration.new/yast2-registration.changes 2018-03-07 10:29:34.777511949 +0100 @@ -1,0 +2,7 @@ +Mon Mar 5 10:14:28 UTC 2018 - lsle...@suse.cz + +- Display additional error details when refreshing a service fails + (related to bsc#1083503) +- 4.0.23 + +------------------------------------------------------------------- Old: ---- yast2-registration-4.0.22.tar.bz2 New: ---- yast2-registration-4.0.23.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.tsPNyQ/_old 2018-03-07 10:29:35.361490884 +0100 +++ /var/tmp/diff_new_pack.tsPNyQ/_new 2018-03-07 10:29:35.365490739 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.0.22 +Version: 4.0.23 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-registration-4.0.22.tar.bz2 -> yast2-registration-4.0.23.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.0.22/package/yast2-registration.changes new/yast2-registration-4.0.23/package/yast2-registration.changes --- old/yast2-registration-4.0.22/package/yast2-registration.changes 2018-02-23 10:39:21.000000000 +0100 +++ new/yast2-registration-4.0.23/package/yast2-registration.changes 2018-03-05 12:46:35.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Mar 5 10:14:28 UTC 2018 - lsle...@suse.cz + +- Display additional error details when refreshing a service fails + (related to bsc#1083503) +- 4.0.23 + +------------------------------------------------------------------- Mon Feb 19 13:08:55 UTC 2018 - lsle...@suse.cz - Support for offline migration from SLE11 to SLE15 (fate#323395) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.0.22/package/yast2-registration.spec new/yast2-registration-4.0.23/package/yast2-registration.spec --- old/yast2-registration-4.0.22/package/yast2-registration.spec 2018-02-23 10:39:21.000000000 +0100 +++ new/yast2-registration-4.0.23/package/yast2-registration.spec 2018-03-05 12:46:35.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.0.22 +Version: 4.0.23 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.0.22/src/lib/registration/connect_helpers.rb new/yast2-registration-4.0.23/src/lib/registration/connect_helpers.rb --- old/yast2-registration-4.0.22/src/lib/registration/connect_helpers.rb 2018-02-23 10:39:21.000000000 +0100 +++ new/yast2-registration-4.0.23/src/lib/registration/connect_helpers.rb 2018-03-05 12:46:35.000000000 +0100 @@ -121,11 +121,11 @@ false rescue ::Registration::ServiceError => e log.error("Service error: #{e.message % e.service}") - Yast::Report.Error(_(e.message) % e.service) + report_pkg_error(_(e.message) % e.service) false rescue ::Registration::PkgError => e log.error("Pkg error: #{e.message}") - Yast::Report.Error(_(e.message)) + report_pkg_error(_(e.message)) false rescue OpenSSL::SSL::SSLError => e log.error "OpenSSL error: #{e}" @@ -155,6 +155,13 @@ Yast::Report.Error(error_with_details(msg, error_message)) end + # Report a pkg-bindings error. Display a message with error details from + # libzypp. + # @param msg [String] error message (translated) + def self.report_pkg_error(msg) + report_error(msg, Yast::Pkg.LastError) + end + def self.error_with_details(error, details) return error if !details || details.empty? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.0.22/test/connect_helpers_spec.rb new/yast2-registration-4.0.23/test/connect_helpers_spec.rb --- old/yast2-registration-4.0.22/test/connect_helpers_spec.rb 2018-02-23 10:39:21.000000000 +0100 +++ new/yast2-registration-4.0.23/test/connect_helpers_spec.rb 2018-03-05 12:46:35.000000000 +0100 @@ -169,6 +169,20 @@ exceptions.each do |exception| context "exception #{exception} is raised" do include_examples "reports error and returns false", exception + + it "reports an error with Pkg details" do + expect(Yast::Pkg).to receive(:LastError).and_return("PkgLastError") + expect(Yast::Report).to receive(:Error).with(/Details: PkgLastError/) + + helpers.catch_registration_errors { raise exception } + end + + it "reports an error without Pkg details if it is empty" do + expect(Yast::Pkg).to receive(:LastError).and_return("") + expect(Yast::Report).to_not receive(:Error).with(/Details:/) + + helpers.catch_registration_errors { raise exception } + end end end