[yast-commit] [ci_new_pac] JFYI yast2-network -> sle12
Script 'mail_helper' called by ro Hello packager, This is just FYI. Your package was checked in in distribution "sle12" by autobuild-member: ro. Here comes the log... ---------------------------%<------------------------------ Hi, here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2-network -> sle12 ## BNC# 868830 : "Registration during installation not working due to missing network setup" (RESOLVED/FIXED) Changes: -------- --- /work/SRC/SUSE:SLE-12:GA/yast2-network/yast2-network.changes 2014-03-17 17:30:53.000000000 +0100 +++ /mounts/work_src_done/SLE12/yast2-network/yast2-network.changes 2014-03-19 18:33:08.000000000 +0100 @@ -1,0 +2,8 @@ +Wed Mar 19 09:53:20 UTC 2014 - mfilka@suse.com + +- bnc#868830 + - remove device also from LanItems' cache when deleting during + automatic configuration in installer +- 3.1.36 + +------------------------------------------------------------------- calling whatdependson for sle12-i586 Packages directly triggered for rebuild: - yast2-network - at least 15 other packages ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/SUSE:SLE-12:GA/yast2-network (Old) and /mounts/work_src_done/SLE12/yast2-network (BS:build ID:34620 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-network", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-network-3.1.35.tar.bz2 New: ---- yast2-network-3.1.36.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.eLvBZT/_old 2014-03-21 15:21:39.000000000 +0100 +++ /var/tmp/diff_new_pack.eLvBZT/_new 2014-03-21 15:21:39.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.35 +Version: 3.1.36 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-network-3.1.35.tar.bz2 -> yast2-network-3.1.36.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.35/package/yast2-network.changes new/yast2-network-3.1.36/package/yast2-network.changes --- old/yast2-network-3.1.35/package/yast2-network.changes 2014-03-17 14:19:50.000000000 +0100 +++ new/yast2-network-3.1.36/package/yast2-network.changes 2014-03-19 18:29:20.000000000 +0100 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Wed Mar 19 09:53:20 UTC 2014 - mfilka@suse.com + +- bnc#868830 + - remove device also from LanItems' cache when deleting during + automatic configuration in installer +- 3.1.36 + +------------------------------------------------------------------- Mon Mar 17 10:54:05 UTC 2014 - mfilka@suse.com - gh#yast/yast-core#74 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.35/package/yast2-network.spec new/yast2-network-3.1.36/package/yast2-network.spec --- old/yast2-network-3.1.35/package/yast2-network.spec 2014-03-17 14:19:50.000000000 +0100 +++ new/yast2-network-3.1.36/package/yast2-network.spec 2014-03-19 18:29:20.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.35 +Version: 3.1.36 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.35/src/clients/inst_setup_dhcp.rb new/yast2-network-3.1.36/src/clients/inst_setup_dhcp.rb --- old/yast2-network-3.1.35/src/clients/inst_setup_dhcp.rb 2014-03-17 14:19:50.000000000 +0100 +++ new/yast2-network-3.1.36/src/clients/inst_setup_dhcp.rb 2014-03-19 18:29:20.000000000 +0100 @@ -47,7 +47,7 @@ end def self.delete_config(devname) - NetworkInterfaces.Delete2(devname) + LanItems.delete_dev(devname) end def self.write_configuration diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.35/src/modules/LanItems.rb new/yast2-network-3.1.36/src/modules/LanItems.rb --- old/yast2-network-3.1.35/src/modules/LanItems.rb 2014-03-17 14:19:50.000000000 +0100 +++ new/yast2-network-3.1.36/src/modules/LanItems.rb 2014-03-19 18:29:20.000000000 +0100 @@ -497,14 +497,21 @@ # Updates device name. # # It updates device's udev rules and config name. + # Updating config name means that old configuration is deleted from + # the system. # # Returns new name def SetItemName( itemId, name) - SetItemUdev("NAME", name) + if name && !name.empty? + SetItemUdev("NAME", name) + else + # rewrite rule for empty name is meaningless + @Items[itemId].delete("udev") + end if @Items[ itemId].has_key?( "ifcfg") NetworkInterfaces.Delete2( @Items[ itemId][ "ifcfg"]) - @Items[ itemId][ "ifcfg"] = name + @Items[ itemId][ "ifcfg"] = name.to_s end name @@ -513,6 +520,8 @@ # Updates current device name. # # It updates device's udev rules and config name. + # Updating config name means that old configuration is deleted from + # the system. # # Returns new name def SetCurrentName( name) @@ -2235,38 +2244,39 @@ deep_copy(tosel) end + # Deletes item and its configuration + # + # Item for deletion is searched using device name + def delete_dev(name) + FindAndSelect(name) + DeleteItem() + end + + # Deletes the {current} item and its configuration def DeleteItem - Builtins.y2milestone("deleting ... %1", Ops.get_map(@Items, @current, {})) - ifcfg = Ops.get_string(@Items, [@current, "ifcfg"], "") - hwcfg = Ops.get_string(@Items, [@current, "hwcfg"], "") + return if @current < 0 + return if @Items.nil? || @Items.empty? - if IsNotEmpty(ifcfg) - NetworkInterfaces.Delete(ifcfg) + log.info("DeleteItem: #{@Items[@current]}") + + if IsCurrentConfigured() + SetCurrentName("") NetworkInterfaces.Commit - Ops.set(@Items, [@current, "ifcfg"], "") end - if !Ops.greater_than( - Builtins.size(Ops.get_map(@Items, [@current, "hwinfo"], {})), - 0 - ) - tmp_items = {} - Builtins.foreach(@Items) do |key, value| - if key == @current - next - else - if Ops.less_than(key, @current) - Ops.set(tmp_items, key, Ops.get_map(@Items, key, {})) - else - Ops.set( - tmp_items, - Ops.subtract(key, 1), - Ops.get_map(@Items, key, {}) - ) - end - end - end - @Items = deep_copy(tmp_items) + + current_item = @Items[@current] + + if current_item["hwinfo"].nil? || current_item["hwinfo"].empty? + # size is always > 0 here and items are numbered 0, 1, ..., size -1 + delete_index = @Items.size - 1 + + @Items[@current] = @Items[delete_index] if delete_index != @current + @Items.delete(delete_index) + + # item was deleted, so original @current is invalid + @current = -1 end + SetModified() nil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.35/test/lan_items_helpers_test.rb new/yast2-network-3.1.36/test/lan_items_helpers_test.rb --- old/yast2-network-3.1.35/test/lan_items_helpers_test.rb 2014-03-17 14:19:50.000000000 +0100 +++ new/yast2-network-3.1.36/test/lan_items_helpers_test.rb 2014-03-19 18:29:20.000000000 +0100 @@ -26,3 +26,21 @@ expect(Yast::LanItems.IsItemConfigured(0)).to be_false end end + +describe "LanItemsClass#delete_dev" do + + MOCKED_ITEMS = { + 0 => { + "ifcfg" => "enp0s3" + } + } + + before(:each) do + Yast::LanItems.Items = MOCKED_ITEMS + end + + it "removes device config when found" do + Yast::LanItems.delete_dev("enp0s3") + expect(Yast::LanItems.Items).to be_empty + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.35/test/netcard_test.rb new/yast2-network-3.1.36/test/netcard_test.rb --- old/yast2-network-3.1.35/test/netcard_test.rb 2014-03-17 14:19:50.000000000 +0100 +++ new/yast2-network-3.1.36/test/netcard_test.rb 2014-03-19 18:29:20.000000000 +0100 @@ -57,6 +57,14 @@ 3 => {"ifcfg" => "br0"}, 4 => {"ifcfg" => "tun0"}, 5 => {"ifcfg" => "tap0"}, + # devices with configuration and hwinfo + 6 => { + "ifcfg" => "enp0s3", + "hwinfo" => { + "name" => "SUSE test card", + "dev_name" => "enp0s3" + } + }, } require "yast" @@ -82,7 +90,7 @@ end it "can return list of device names available in the system" do - expected_names = ["bond0", "br0", "eth1", "eth11", "tap0", "tun0"] + expected_names = ["bond0", "br0", "eth1", "eth11", "enp0s3", "tap0", "tun0"].sort expect(@lan_items.GetNetcardNames.sort).to eq expected_names end @@ -171,3 +179,39 @@ end end end + + +describe "LanItemsClass#DeleteItem" do + before(:each) do + @lan_items = Yast::LanItems + @lan_items.main + @lan_items.Items = MOCKED_ITEMS + end + + it "removes an existing item" do + before_items = nil + + while before_items != @lan_items.Items && !@lan_items.Items.empty? + @lan_items.current = 0 + + item_name = @lan_items.GetCurrentName + before_items = @lan_items.Items + + @lan_items.DeleteItem + + expect(@lan_items.FindAndSelect(item_name)).to be_false + end + end + + it "removes only the configuration if the item has hwinfo" do + before_size = @lan_items.Items.size + item_name = "enp0s3" + + expect(@lan_items.FindAndSelect(item_name)).to be_true + + @lan_items.DeleteItem + + expect(@lan_items.FindAndSelect(item_name)).to be_false + expect(@lan_items.Items.size).to eql before_size + end +end continue with "q"... Checked in at Fri Mar 21 15:21:44 CET 2014 by ro Remember to have fun... -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
ro