Hello community, here is the log from the commit of package autoyast2 for openSUSE:Factory checked in at 2019-02-28 21:47:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old) and /work/SRC/openSUSE:Factory/.autoyast2.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "autoyast2" Thu Feb 28 21:47:08 2019 rev:255 rq:678938 version:4.1.2 Changes: -------- --- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes 2019-02-15 09:53:33.507794909 +0100 +++ /work/SRC/openSUSE:Factory/.autoyast2.new.28833/autoyast2.changes 2019-02-28 21:47:09.905428715 +0100 @@ -1,0 +2,7 @@ +Fri Feb 22 16:40:30 UTC 2019 - dgonzalez@suse.com + +- Avoid to crash when the profile has a not valid sofware section + (bsc#1125959). +- 4.1.2 + +------------------------------------------------------------------- Old: ---- autoyast2-4.1.1.tar.bz2 New: ---- autoyast2-4.1.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ autoyast2.spec ++++++ --- /var/tmp/diff_new_pack.FQM1HE/_old 2019-02-28 21:47:10.497428462 +0100 +++ /var/tmp/diff_new_pack.FQM1HE/_new 2019-02-28 21:47:10.501428461 +0100 @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.1.1 +Version: 4.1.2 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ autoyast2-4.1.1.tar.bz2 -> autoyast2-4.1.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.1.1/package/autoyast2.changes new/autoyast2-4.1.2/package/autoyast2.changes --- old/autoyast2-4.1.1/package/autoyast2.changes 2019-02-13 10:31:25.000000000 +0100 +++ new/autoyast2-4.1.2/package/autoyast2.changes 2019-02-25 15:59:52.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri Feb 22 16:40:30 UTC 2019 - dgonzalez@suse.com + +- Avoid to crash when the profile has a not valid sofware section + (bsc#1125959). +- 4.1.2 + +------------------------------------------------------------------- Tue Feb 12 13:50:19 CET 2019 - schubi@suse.de - Reading IPv6 setting in order to initialize it correctly. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.1.1/package/autoyast2.spec new/autoyast2-4.1.2/package/autoyast2.spec --- old/autoyast2-4.1.1/package/autoyast2.spec 2019-02-13 10:31:25.000000000 +0100 +++ new/autoyast2-4.1.2/package/autoyast2.spec 2019-02-25 15:59:52.000000000 +0100 @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 4.1.1 +Version: 4.1.2 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.1.1/src/modules/AutoinstFunctions.rb new/autoyast2-4.1.2/src/modules/AutoinstFunctions.rb --- old/autoyast2-4.1.1/src/modules/AutoinstFunctions.rb 2019-02-13 10:31:25.000000000 +0100 +++ new/autoyast2-4.1.2/src/modules/AutoinstFunctions.rb 2019-02-25 15:59:52.000000000 +0100 @@ -136,7 +136,7 @@ # @return [Y2Packager::Product] a product if exactly one product matches # the criteria, nil otherwise def identify_product_by_patterns(profile) - software = profile.fetch("software", {}) + software = profile["software"] || {} identify_product do |product| software.fetch("patterns", []).any? { |p| p =~ /#{product.name.downcase}-.*/ } @@ -151,7 +151,7 @@ # @return [Y2Packager::Product] a product if exactly one product matches # the criteria, nil otherwise def identify_product_by_packages(profile) - software = profile.fetch("software", {}) + software = profile["software"] || {} identify_product do |product| software.fetch("packages", []).any? { |p| p =~ /#{product.name.downcase}-release/ } @@ -180,7 +180,14 @@ # @param profile [Hash] AutoYaST profile # @return [String] product name def base_product_name(profile) - software = profile.fetch("software", {}) + software = profile["software"] + + if software.nil? + log.info("Error: given profile has not a valid software section") + + return nil + end + software.fetch("products", []).first end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-4.1.1/test/AutoinstFunctions_test.rb new/autoyast2-4.1.2/test/AutoinstFunctions_test.rb --- old/autoyast2-4.1.1/test/AutoinstFunctions_test.rb 2019-02-13 10:31:25.000000000 +0100 +++ new/autoyast2-4.1.2/test/AutoinstFunctions_test.rb 2019-02-25 15:59:52.000000000 +0100 @@ -176,5 +176,23 @@ expect(subject.selected_product.name).to eql "SLED" end + + context "when there is not a valid software section" do + before do + allow(Yast::Profile) + .to receive(:current) + .and_return("software" => nil) + end + + it "returns nil" do + expect(subject.selected_product).to be_nil + end + + it "logs a message" do + expect(subject.log).to receive(:info).at_least(1).with(/not a valid software section/) + + subject.selected_product + end + end end end
participants (1)
-
root