Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2019-02-04 16:09:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network" Mon Feb 4 16:09:42 2019 rev:400 rq:670281 version:4.1.36 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2019-01-24 14:01:08.416207151 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-network.new.28833/yast2-network.changes 2019-02-04 16:09:46.501996863 +0100 @@ -1,0 +2,16 @@ +Tue Jan 29 10:32:17 UTC 2019 - [email protected] + +- bnc#1123102 + - do not crash with internal error when no hostname is set when + submitting device with static configuration +- 4.1.36 + +------------------------------------------------------------------- +Fri Jan 25 13:24:03 UTC 2019 - [email protected] + +- bsc#112952 + - Try to install the wireless-tools package when the package is + not installed and the wifi networks are scanned. +- 4.1.35 + +------------------------------------------------------------------- Old: ---- yast2-network-4.1.34.tar.bz2 New: ---- yast2-network-4.1.36.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.NWW9QN/_old 2019-02-04 16:09:47.125996475 +0100 +++ /var/tmp/diff_new_pack.NWW9QN/_new 2019-02-04 16:09:47.129996471 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.1.34 +Version: 4.1.36 Release: 0 BuildArch: noarch ++++++ yast2-network-4.1.34.tar.bz2 -> yast2-network-4.1.36.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.34/package/yast2-network.changes new/yast2-network-4.1.36/package/yast2-network.changes --- old/yast2-network-4.1.34/package/yast2-network.changes 2019-01-23 11:43:01.000000000 +0100 +++ new/yast2-network-4.1.36/package/yast2-network.changes 2019-01-31 10:14:34.000000000 +0100 @@ -1,4 +1,20 @@ ------------------------------------------------------------------- +Tue Jan 29 10:32:17 UTC 2019 - [email protected] + +- bnc#1123102 + - do not crash with internal error when no hostname is set when + submitting device with static configuration +- 4.1.36 + +------------------------------------------------------------------- +Fri Jan 25 13:24:03 UTC 2019 - [email protected] + +- bsc#112952 + - Try to install the wireless-tools package when the package is + not installed and the wifi networks are scanned. +- 4.1.35 + +------------------------------------------------------------------- Wed Jan 23 08:52:03 UTC 2019 - [email protected] - bnc#1122387 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.34/package/yast2-network.spec new/yast2-network-4.1.36/package/yast2-network.spec --- old/yast2-network-4.1.34/package/yast2-network.spec 2019-01-23 11:43:01.000000000 +0100 +++ new/yast2-network-4.1.36/package/yast2-network.spec 2019-01-31 10:14:34.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.1.34 +Version: 4.1.36 Release: 0 BuildArch: noarch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.34/src/include/network/lan/address.rb new/yast2-network-4.1.36/src/include/network/lan/address.rb --- old/yast2-network-4.1.34/src/include/network/lan/address.rb 2019-01-23 11:43:01.000000000 +0100 +++ new/yast2-network-4.1.36/src/include/network/lan/address.rb 2019-01-31 10:14:34.000000000 +0100 @@ -1129,7 +1129,12 @@ end def address_tab - type = LanItems.GetCurrentType + # in case that ifcfg does not exist, /sys might not cointain + # any device info (especially for virtual devices like vlan) + # @type variable is already initialized by @see HardwareDialog + # resp its storage handler @see storeHW + type = LanItems.type + drvtype = DriverType(type) is_ptp = drvtype == "ctc" || drvtype == "iucv" # TODO: dynamic for dummy. or add dummy from outside? @@ -1350,8 +1355,6 @@ Builtins.y2milestone("ShowAndRun: %1", ret) - LanItems.Rollback if ret == :abort - if ret != :back && ret != :abort # general tab LanItems.startmode = Ops.get_string(@settings, "STARTMODE", "") @@ -1521,7 +1524,7 @@ names = Host.names(LanItems.ipaddr).first Host.remove_ip(LanItems.ipaddr) - if ip_changed && !hostname_changed + if ip_changed && !hostname_changed && !names.nil? log.info("Dropping record for #{LanItems.ipaddr} from /etc/hosts") Host.add_name(ipaddr, names) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.34/src/include/network/lan/wireless.rb new/yast2-network-4.1.36/src/include/network/lan/wireless.rb --- old/yast2-network-4.1.34/src/include/network/lan/wireless.rb 2019-01-23 11:43:01.000000000 +0100 +++ new/yast2-network-4.1.36/src/include/network/lan/wireless.rb 2019-01-31 10:14:34.000000000 +0100 @@ -643,25 +643,27 @@ end break when :scan_for_networks - command = Builtins.sformat( - "/usr/sbin/ip link set %1 up && /usr/sbin/iwlist %1 scan | " \ - "/usr/bin/grep ESSID | /usr/bin/cut -d':' -f2 | " \ - "/usr/bin/cut -d'\"' -f2 | /usr/bin/sort -u", - Ops.get_string(LanItems.Items, [LanItems.current, "ifcfg"], "").shellescape - ) - output = Convert.convert( - SCR.Execute(path(".target.bash_output"), command), - from: "any", - to: "map <string, any>" - ) - - if Ops.get_integer(output, "exit", -1) == 0 - networks = Builtins.splitstring( - Ops.get_string(output, "stdout", ""), - "\n" + if scan_supported? + command = Builtins.sformat( + "/usr/sbin/ip link set %1 up && /usr/sbin/iwlist %1 scan | " \ + "/usr/bin/grep ESSID | /usr/bin/cut -d':' -f2 | " \ + "/usr/bin/cut -d'\"' -f2 | /usr/bin/sort -u", + Ops.get_string(LanItems.Items, [LanItems.current, "ifcfg"], "").shellescape ) - Builtins.y2milestone("Found networks : %1", networks) - UI.ChangeWidget(:essid, :Items, networks) + output = Convert.convert( + SCR.Execute(path(".target.bash_output"), command), + from: "any", + to: "map <string, any>" + ) + + if Ops.get_integer(output, "exit", -1) == 0 + networks = Builtins.splitstring( + Ops.get_string(output, "stdout", ""), + "\n" + ) + Builtins.y2milestone("Found networks : %1", networks) + UI.ChangeWidget(:essid, :Items, networks) + end end when :authmode # do nothing @@ -1394,5 +1396,21 @@ "fallback_functions" => functions ) end + + private + + IWLIST_PKG = "wireless-tools".freeze + + def scan_supported? + # Require wireless-tools installation in order to be able to scan the + # wlan network (bsc#1112952) + return true if Stage.initial || Package.Installed(IWLIST_PKG) || Package.Install(IWLIST_PKG) + + Popup.Error( + _("The package %s was not installed. It is needed in order to " \ + "be able to scan the network") % IWLIST_PKG + ) + false + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.34/src/modules/LanItems.rb new/yast2-network-4.1.36/src/modules/LanItems.rb --- old/yast2-network-4.1.34/src/modules/LanItems.rb 2019-01-23 11:43:01.000000000 +0100 +++ new/yast2-network-4.1.36/src/modules/LanItems.rb 2019-01-31 10:14:34.000000000 +0100 @@ -284,11 +284,6 @@ # # @param itemId [Integer] a key for {#Items} def GetDeviceType(itemId) - # in such case ifcfg is not existing and /sys might not contain - # any device info (especially for virtual devices like vlan) - # @type variable is already initialized by @see HardwareDialog - # resp its storage handler @see storeHW - return @type if @operation == :add NetworkInterfaces.GetType(GetDeviceName(itemId)) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.34/test/address_test.rb new/yast2-network-4.1.36/test/address_test.rb --- old/yast2-network-4.1.34/test/address_test.rb 2019-01-23 11:43:01.000000000 +0100 +++ new/yast2-network-4.1.36/test/address_test.rb 2019-01-31 10:14:34.000000000 +0100 @@ -106,24 +106,39 @@ .and_return(["#{initial_hostname} custom-name"]) end - it "drops old /etc/hosts record if hostname was changed" do - expect(Yast::Host) - .to receive(:remove_ip) - .with(ip) - expect(Yast::Host) - .to receive(:Update) - .with(initial_hostname, new_hostname, ip) + context "when ip has not changed" do + it "drops old /etc/hosts record if hostname was changed" do + expect(Yast::Host) + .to receive(:remove_ip) + .with(ip) + expect(Yast::Host) + .to receive(:Update) + .with(initial_hostname, new_hostname, ip) - subject.send(:update_hostname, ip, new_hostname) + subject.send(:update_hostname, ip, new_hostname) + end end - it "keeps names untouched when only the ip was changed" do - new_ip = "2.2.2.2" + context "when ip has changed" do + it "keeps names if there is no change in hostname" do + new_ip = "2.2.2.2" + + original_names = Yast::Host.names(ip) + subject.send(:update_hostname, new_ip, initial_hostname) + + expect(Yast::Host.names(new_ip)).to eql original_names + end + + it "does not crash when no hostnames exist for old ip and new hostname is not set" do + new_ip = "2.2.2.2" + + # targeted especially against newly created devices ;-) + allow(Yast::LanItems) + .to receive(:ipaddr) + .and_return("") - original_names = Yast::Host.names(ip) - subject.send(:update_hostname, new_ip, initial_hostname) - - expect(Yast::Host.names(new_ip)).to eql original_names + expect { subject.send(:update_hostname, new_ip, "") }.not_to raise_error + end end end
