Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2014-03-21 12:14:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-network" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2014-03-06 19:29:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2014-03-21 12:14:36.000000000 +0100 @@ -1,0 +2,38 @@ +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 + - automatic dhcp configuration is unable to clear unused + configurations. It blocks starting manual configuration dialog. +- 3.1.35 + +------------------------------------------------------------------- +Sat Mar 15 22:54:30 UTC 2014 - mfilka@suse.com + +- bnc#868436 + - fixed internal error at the begining of installation +- 3.1.34 + +------------------------------------------------------------------- +Wed Mar 12 08:01:43 UTC 2014 - mfilka@suse.com + +- bnc#866827, fate#314695 + - show a dialog for network configuration when autoconfiguration + is unable to proceed +- 3.1.33 + +------------------------------------------------------------------- +Mon Mar 10 10:54:18 CET 2014 - locilka@suse.com + +- Fixed Yast Remote to allow enabling vnc-httpd and vnc-server + services in firewall (bnc#867377). +- 3.1.32 + +------------------------------------------------------------------- Old: ---- yast2-network-3.1.31.tar.bz2 New: ---- yast2-network-3.1.36.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.JXYisx/_old 2014-03-21 12:14:38.000000000 +0100 +++ /var/tmp/diff_new_pack.JXYisx/_new 2014-03-21 12:14:38.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.31 +Version: 3.1.36 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-network-3.1.31.tar.bz2 -> yast2-network-3.1.36.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.31/package/yast2-network.changes new/yast2-network-3.1.36/package/yast2-network.changes --- old/yast2-network-3.1.31/package/yast2-network.changes 2014-03-06 10:00:20.000000000 +0100 +++ new/yast2-network-3.1.36/package/yast2-network.changes 2014-03-19 18:32:43.000000000 +0100 @@ -1,4 +1,42 @@ ------------------------------------------------------------------- +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 + - automatic dhcp configuration is unable to clear unused + configurations. It blocks starting manual configuration dialog. +- 3.1.35 + +------------------------------------------------------------------- +Sat Mar 15 22:54:30 UTC 2014 - mfilka@suse.com + +- bnc#868436 + - fixed internal error at the begining of installation +- 3.1.34 + +------------------------------------------------------------------- +Wed Mar 12 08:01:43 UTC 2014 - mfilka@suse.com + +- bnc#866827, fate#314695 + - show a dialog for network configuration when autoconfiguration + is unable to proceed +- 3.1.33 + +------------------------------------------------------------------- +Mon Mar 10 10:54:18 CET 2014 - locilka@suse.com + +- Fixed Yast Remote to allow enabling vnc-httpd and vnc-server + services in firewall (bnc#867377). +- 3.1.32 + +------------------------------------------------------------------- Wed Mar 5 10:11:41 UTC 2014 - mvidner@suse.com - bnc#865707 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.31/package/yast2-network.spec new/yast2-network-3.1.36/package/yast2-network.spec --- old/yast2-network-3.1.31/package/yast2-network.spec 2014-03-06 10:00:20.000000000 +0100 +++ new/yast2-network-3.1.36/package/yast2-network.spec 2014-03-19 18:32:43.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.31 +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.31/src/clients/inst_lan.rb new/yast2-network-3.1.36/src/clients/inst_lan.rb --- old/yast2-network-3.1.31/src/clients/inst_lan.rb 2014-03-06 10:00:20.000000000 +0100 +++ new/yast2-network-3.1.36/src/clients/inst_lan.rb 2014-03-19 18:32:44.000000000 +0100 @@ -31,38 +31,34 @@ # Uses all other files. module Yast class InstLanClient < Client + include Logger + def main Yast.import "UI" - - #** - # <h3>Network configuration</h3> - - textdomain "network" - - # The main () - Builtins.y2milestone("----------------------------------------") - Builtins.y2milestone("Lan module started") - Yast.import "Label" Yast.import "Lan" Yast.import "RichText" + textdomain "network" + + log.info("----------------------------------------") + log.info("Lan module started") + Yast.include self, "network/lan/cmdline.rb" Yast.include self, "network/lan/wizards.rb" - @ret = LanSequence() + conf_net = LanItems.Items.keys.any? { |i| LanItems.IsItemConfigured(i) } - Builtins.y2internal("Network inst ret = %1", @ret) - Builtins.y2debug("ret=%1", @ret) + log.info("Configured network found: #{conf_net}") - # Finish - Builtins.y2milestone("Lan module finished") - Builtins.y2milestone("----------------------------------------") + ret = !conf_net ? LanSequence() : :next - deep_copy(@ret) - # EOF + log.info("Lan module finished, ret = #{ret}") + log.info("----------------------------------------") + + ret end end -end -Yast::InstLanClient.new.main + Yast::InstLanClient.new.main +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.31/src/clients/inst_setup_dhcp.rb new/yast2-network-3.1.36/src/clients/inst_setup_dhcp.rb --- old/yast2-network-3.1.31/src/clients/inst_setup_dhcp.rb 2014-03-06 10:00:20.000000000 +0100 +++ new/yast2-network-3.1.36/src/clients/inst_setup_dhcp.rb 2014-03-19 18:32:44.000000000 +0100 @@ -47,7 +47,7 @@ end def self.delete_config(devname) - NetworkInterfaces.Delete2(devname) + LanItems.delete_dev(devname) end def self.write_configuration @@ -84,10 +84,13 @@ log.info "Candidates for enabling DHCP: #{dhcp_cards}" # TODO time consuming, some progress would be nice - dhcp_cards.each { |d| setup_dhcp(d) } + dhcp_cards.each { |d| setup_dhcp(d) } activate_changes(dhcp_cards) + # workaround for gh#yast/yast-core#74 (https://github.com/yast/yast-core/issues/74) + NetworkInterfaces.CleanCacheRead() + # drop devices without dhcp lease inactive_devices = dhcp_cards.select { |c| ! active_config?(c) } log.info "Inactive devices: #{inactive_devices}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.31/src/include/network/remote/dialogs.rb new/yast2-network-3.1.36/src/include/network/remote/dialogs.rb --- old/yast2-network-3.1.31/src/include/network/remote/dialogs.rb 2014-03-06 10:00:20.000000000 +0100 +++ new/yast2-network-3.1.36/src/include/network/remote/dialogs.rb 2014-03-19 18:32:44.000000000 +0100 @@ -78,7 +78,7 @@ ) firewall_widget = CWMFirewallInterfaces.CreateOpenFirewallWidget( - { "services" => ["service:xorg-x11-Xvnc"], "display_details" => true } + { "services" => ["service:vnc-httpd", "service:vnc-server"], "display_details" => true } ) firewall_layout = Ops.get_term(firewall_widget, "custom_widget", VBox()) firewall_help = Ops.get_string(firewall_widget, "help", "") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.31/src/modules/LanItems.rb new/yast2-network-3.1.36/src/modules/LanItems.rb --- old/yast2-network-3.1.31/src/modules/LanItems.rb 2014-03-06 10:00:20.000000000 +0100 +++ new/yast2-network-3.1.36/src/modules/LanItems.rb 2014-03-19 18:32:44.000000000 +0100 @@ -28,6 +28,8 @@ attr_reader :ipoib_modes attr_accessor :ipoib_mode + include Logger + def main Yast.import "UI" textdomain "network" @@ -306,18 +308,10 @@ # Returns true if the item (see LanItems::Items) has # netconfig configuration. def IsItemConfigured(itemId) - ret = false - - if Ops.greater_than( - Builtins.size(Ops.get_string(GetLanItem(itemId), "ifcfg", "")), - 0 - ) - ret = true - end - - Builtins.y2milestone("is item %1 configured? %2", itemId, ret) + ret = !GetLanItem(itemId)["ifcfg"].to_s.empty? + log.info("IsItemConfigured: item=#{itemId} configured=#{ret}") - ret + return ret end # Returns true if current (see LanItems::current) has @@ -503,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 @@ -519,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) @@ -2241,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? + + log.info("DeleteItem: #{@Items[@current]}") - if IsNotEmpty(ifcfg) - NetworkInterfaces.Delete(ifcfg) + 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.31/test/Makefile.am new/yast2-network-3.1.36/test/Makefile.am --- old/yast2-network-3.1.31/test/Makefile.am 2014-03-06 10:00:20.000000000 +0100 +++ new/yast2-network-3.1.36/test/Makefile.am 2014-03-19 18:32:44.000000000 +0100 @@ -6,7 +6,8 @@ routing_test.rb \ new_device_startmode_test.rb \ widgets_test.rb \ - install_inf_convertor_test.rb + install_inf_convertor_test.rb \ + lan_items_helpers_test.rb TEST_EXTENSIONS = .rb RB_LOG_COMPILER = rspec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.31/test/lan_items_helpers_test.rb new/yast2-network-3.1.36/test/lan_items_helpers_test.rb --- old/yast2-network-3.1.31/test/lan_items_helpers_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.36/test/lan_items_helpers_test.rb 2014-03-19 18:32:44.000000000 +0100 @@ -0,0 +1,46 @@ +#!/usr/bin/env rspec + +ENV["Y2DIR"] = File.expand_path("../../src", __FILE__) + +require "yast" + +Yast.import "LanItems" + +describe "LanItemsClass#IsItemConfigured" do + + it "succeeds when item has configuration" do + Yast::LanItems.stub(:GetLanItem) { { "ifcfg" => "enp0s3" } } + + expect(Yast::LanItems.IsItemConfigured(0)).to be_true + end + + it "fails when item doesn't exist" do + Yast::LanItems.stub(:GetLanItem) { {} } + + expect(Yast::LanItems.IsItemConfigured(0)).to be_false + end + + it "fails when item's configuration doesn't exist" do + Yast::LanItems.stub(:GetLanItem) { { "ifcfg" => nil } } + + 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.31/test/netcard_test.rb new/yast2-network-3.1.36/test/netcard_test.rb --- old/yast2-network-3.1.31/test/netcard_test.rb 2014-03-06 10:00:20.000000000 +0100 +++ new/yast2-network-3.1.36/test/netcard_test.rb 2014-03-19 18:32:44.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 -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org