Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2021-09-28 19:16:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network" Tue Sep 28 19:16:26 2021 rev:463 rq:921959 version:4.4.26 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2021-09-26 21:49:00.422800480 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new.1899/yast2-network.changes 2021-09-28 19:16:33.408187541 +0200 @@ -1,0 +2,9 @@ +Mon Sep 27 09:12:23 UTC 2021 - Knut Anderssen <kanders...@suse.com> + +- Do not crash when the interfaces table contains a not configured + one (bnc#1190645, bsc#1190915) +- Fix the shown description using the interface friendly name when + it is empty (bsc#1190933) +- 4.4.26 + +------------------------------------------------------------------- Old: ---- yast2-network-4.4.25.tar.bz2 New: ---- yast2-network-4.4.26.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.TM6PlS/_old 2021-09-28 19:16:33.960188177 +0200 +++ /var/tmp/diff_new_pack.TM6PlS/_new 2021-09-28 19:16:33.960188177 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.4.25 +Version: 4.4.26 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only ++++++ yast2-network-4.4.25.tar.bz2 -> yast2-network-4.4.26.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.4.25/package/yast2-network.changes new/yast2-network-4.4.26/package/yast2-network.changes --- old/yast2-network-4.4.25/package/yast2-network.changes 2021-09-24 14:00:23.000000000 +0200 +++ new/yast2-network-4.4.26/package/yast2-network.changes 2021-09-28 10:49:34.000000000 +0200 @@ -1,4 +1,13 @@ ------------------------------------------------------------------- +Mon Sep 27 09:12:23 UTC 2021 - Knut Anderssen <kanders...@suse.com> + +- Do not crash when the interfaces table contains a not configured + one (bnc#1190645, bsc#1190915) +- Fix the shown description using the interface friendly name when + it is empty (bsc#1190933) +- 4.4.26 + +------------------------------------------------------------------- Thu Sep 23 10:01:21 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> - Consider aliases sections as case insensitive (bsc#1190739). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.4.25/package/yast2-network.spec new/yast2-network-4.4.26/package/yast2-network.spec --- old/yast2-network-4.4.25/package/yast2-network.spec 2021-09-24 14:00:23.000000000 +0200 +++ new/yast2-network-4.4.26/package/yast2-network.spec 2021-09-28 10:49:34.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.4.25 +Version: 4.4.26 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.4.25/src/lib/y2network/connection_config/base.rb new/yast2-network-4.4.26/src/lib/y2network/connection_config/base.rb --- old/yast2-network-4.4.25/src/lib/y2network/connection_config/base.rb 2021-09-24 14:00:23.000000000 +0200 +++ new/yast2-network-4.4.26/src/lib/y2network/connection_config/base.rb 2021-09-28 10:49:34.000000000 +0200 @@ -65,7 +65,7 @@ attr_accessor :mtu # @return [Startmode] attr_accessor :startmode - # @return [String] Connection's description (e.g., "Ethernet Card 0") + # @return [String, nil] Connection's custom description (e.g., "Ethernet Card 0") attr_accessor :description # @return [String] Link layer address attr_accessor :lladdress @@ -93,7 +93,6 @@ @bootproto = BootProtocol::STATIC @ip = IPConfig.new(IPAddress.from_string("0.0.0.0/32")) @startmode = Startmode.create("manual") - @description = "" @ethtool_options = "" @firewall_zone = "" @hostnames = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.4.25/src/lib/y2network/widgets/interfaces_table.rb new/yast2-network-4.4.26/src/lib/y2network/widgets/interfaces_table.rb --- old/yast2-network-4.4.25/src/lib/y2network/widgets/interfaces_table.rb 2021-09-24 14:00:23.000000000 +0200 +++ new/yast2-network-4.4.26/src/lib/y2network/widgets/interfaces_table.rb 2021-09-28 10:49:34.000000000 +0200 @@ -110,8 +110,7 @@ [ # first is (item) ID in table interface.name, - # if user named the connection explicitly, it will have precendence - conn.description || friendly_name(interface), + description_for(interface, conn), interface_protocol(conn), interface.name, note(interface, conn) @@ -144,11 +143,15 @@ summary.new(value, config).text end - # Returns a friendly name for a given interface + # Returns the connection description if given or the interface friendly name if not # # @param interface [Interface] Network interface - # @return [String] Friendly name for the interface (description or name) - def friendly_name(interface) + # @param conn [ConnectionConfig::Base, nil] Connection configuration + # @return [String] Connection description if given or the friendly name for the interface ( + # description or name) if not + def description_for(interface, conn) + return conn.description unless conn&.description.to_s.empty? + hwinfo = interface.hardware (hwinfo&.present?) ? hwinfo.description : interface.name end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.4.25/test/y2network/widgets/interfaces_table_test.rb new/yast2-network-4.4.26/test/y2network/widgets/interfaces_table_test.rb --- old/yast2-network-4.4.25/test/y2network/widgets/interfaces_table_test.rb 2021-09-24 14:00:23.000000000 +0200 +++ new/yast2-network-4.4.26/test/y2network/widgets/interfaces_table_test.rb 2021-09-28 10:49:34.000000000 +0200 @@ -21,6 +21,7 @@ require "cwm/rspec" require "y2network/widgets/interfaces_table" +require "y2network/virtual_interface" Yast.import "Lan" @@ -38,7 +39,7 @@ let(:interfaces) { Y2Network::InterfacesCollection.new([eth0, br0]) } let(:hwinfo) do instance_double(Y2Network::Hwinfo, link: link, mac: mac, busid: busid, - exists?: exists?, present?: true, description: "", name: "Coold device") + exists?: exists?, present?: true, description: "Cool device", name: "Cool device") end let(:mac) { "01:23:45:67:89:ab" } let(:busid) { "0000:04:00.0" } @@ -61,8 +62,38 @@ include_examples "CWM::Table" - describe "#handle" do + describe "#items" do + context "when it includes a configured device" do + it "includes the connection device name" do + expect(subject.items).to include(a_collection_including(/eth0/)) + end + + context "and the device is named by user" do + let(:eth0_conn) do + Y2Network::ConnectionConfig::Ethernet.new.tap do |c| + c.name = "eth0" + c.description = "Custom description" + end + end + + it "includes its custom device name" do + expect(subject.items).to include(a_collection_including(/Custom description/)) + end + end + end + + context "and the device is not configured" do + let(:connections) { Y2Network::ConnectionConfigsCollection.new([]) } + + it "shows the hwinfo interface description if present or the interface name if not" do + expect(subject.items).to include(a_collection_including(/Cool device/, /eth0/), + a_collection_including(/br0/)) + end + end + + end + describe "#handle" do it "updates the description" do expect(description).to receive(:value=) subject.handle @@ -123,19 +154,6 @@ expect(description).to receive(:value=).with(/Device Name: eth0/) subject.handle end - - context "and when the device is named by user" do - let(:eth0_conn) do - Y2Network::ConnectionConfig::Ethernet.new.tap do |c| - c.name = "eth0" - c.description = "Custom description" - end - end - - it "uses custom device name" do - expect(subject.items).to include(a_collection_including(/Custom description/)) - end - end end context "when the device is not configured" do