Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2014-09-10 07:27:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-09-07 11:09:44.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2014-09-10 07:28:04.000000000 +0200 @@ -1,0 +2,19 @@ +Mon Sep 8 08:55:09 UTC 2014 - mvidner@suse.com + +- Use a more flexible rubygem requirement syntax (bnc#895069) +- 3.1.95 + +------------------------------------------------------------------- +Fri Sep 5 09:48:22 UTC 2014 - mfilka@suse.com + +- bnc#894053 + - it is not possible to rename a device to a name same as an + unconfigured device's one +- bnc#895273 + - when adding new device, whole name is shown instead of only + number. + - it is possible to fill in a name which conforms to a new device + naming scheme +- 3.1.94 + +------------------------------------------------------------------- Old: ---- yast2-network-3.1.93.tar.bz2 New: ---- yast2-network-3.1.95.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.iJZRQT/_old 2014-09-10 07:28:05.000000000 +0200 +++ /var/tmp/diff_new_pack.iJZRQT/_new 2014-09-10 07:28:05.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.93 +Version: 3.1.95 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -48,7 +48,7 @@ Requires: yast2-storage >= 2.21.11 # testsuite -BuildRequires: rubygem-rspec +BuildRequires: rubygem(rspec) PreReq: /bin/rm ++++++ yast2-network-3.1.93.tar.bz2 -> yast2-network-3.1.95.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.93/package/yast2-network.changes new/yast2-network-3.1.95/package/yast2-network.changes --- old/yast2-network-3.1.93/package/yast2-network.changes 2014-09-04 12:53:09.000000000 +0200 +++ new/yast2-network-3.1.95/package/yast2-network.changes 2014-09-08 11:13:24.000000000 +0200 @@ -1,4 +1,23 @@ ------------------------------------------------------------------- +Mon Sep 8 08:55:09 UTC 2014 - mvidner@suse.com + +- Use a more flexible rubygem requirement syntax (bnc#895069) +- 3.1.95 + +------------------------------------------------------------------- +Fri Sep 5 09:48:22 UTC 2014 - mfilka@suse.com + +- bnc#894053 + - it is not possible to rename a device to a name same as an + unconfigured device's one +- bnc#895273 + - when adding new device, whole name is shown instead of only + number. + - it is possible to fill in a name which conforms to a new device + naming scheme +- 3.1.94 + +------------------------------------------------------------------- Thu Sep 4 11:03:29 CEST 2014 - locilka@suse.com - Fixed firewall proposal to survive missing SuSEfirewall2 services diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.93/package/yast2-network.spec new/yast2-network-3.1.95/package/yast2-network.spec --- old/yast2-network-3.1.93/package/yast2-network.spec 2014-09-04 12:53:09.000000000 +0200 +++ new/yast2-network-3.1.95/package/yast2-network.spec 2014-09-08 11:13:24.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.93 +Version: 3.1.95 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -48,7 +48,7 @@ Requires: yast2-storage >= 2.21.11 # testsuite -BuildRequires: rubygem-rspec +BuildRequires: rubygem(rspec) PreReq: /bin/rm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.93/src/include/network/lan/hardware.rb new/yast2-network-3.1.95/src/include/network/lan/hardware.rb --- old/yast2-network-3.1.93/src/include/network/lan/hardware.rb 2014-09-04 12:53:09.000000000 +0200 +++ new/yast2-network-3.1.95/src/include/network/lan/hardware.rb 2014-09-08 11:13:24.000000000 +0200 @@ -53,12 +53,14 @@ @widget_descr_hardware = { "HWDIALOG" => { - "widget" => :custom, - "custom_widget" => ReplacePoint(Id(:hw_content), Empty()), - "init" => fun_ref(method(:initHwDialog), "void (string)"), - "handle" => fun_ref(method(:handleHW), "symbol (string, map)"), - "store" => fun_ref(method(:storeHW), "void (string, map)"), - "help" => initHelp + "widget" => :custom, + "custom_widget" => ReplacePoint(Id(:hw_content), Empty()), + "init" => fun_ref(method(:initHwDialog), "void (string)"), + "handle" => fun_ref(method(:handleHW), "symbol (string, map)"), + "store" => fun_ref(method(:storeHW), "void (string, map)"), + "validate_type" => :function, + "validate_function" => fun_ref(method(:validate_hw), "boolean (string, map)"), + "help" => initHelp } } end @@ -348,7 +350,7 @@ Id(:rnum), # TextEntry label ComboBox( - Id(:num), + Id(:ifcfg_name), Opt(:editable, :hstretch), _("&Configuration Name"), [@hardware["device"] || ""] @@ -361,7 +363,7 @@ HBox( HSpacing(0.5), ComboBox( - Id(:dev), + Id(:type), Opt(:hstretch, :notify), # ComboBox label _("&Device Type"), @@ -377,7 +379,6 @@ ) _UdevWidget = - # TODO: Ud ... Rules Frame( _("Udev Rules"), HBox( @@ -395,7 +396,7 @@ _BlinkCard = Frame( _("Show Visible Port Identification"), HBox( - #translators: how many seconds will card be blinking + # translators: how many seconds will card be blinking IntField( Id(:blink_time), "%s:" % _("Seconds"), @@ -466,9 +467,9 @@ ChangeWidgetIfExists(Id(:device_name), :Enabled, false) ChangeWidgetIfExists(Id(:device_name), :Value, device_name) - ChangeWidgetIfExists(Id(:dev), :Enabled, false) if !isNewDevice + ChangeWidgetIfExists(Id(:type), :Enabled, false) if !isNewDevice ChangeWidgetIfExists( - Id(:num), + Id(:ifcfg_name), :ValidChars, NetworkInterfaces.ValidCharsIfcfg ) @@ -596,7 +597,7 @@ ret = Ops.get_symbol(event, "WidgetID") end SelectionDialog() if ret == :list - if ret == :pcmcia || ret == :usb || ret == :dev + if ret == :pcmcia || ret == :usb || ret == :type if UI.WidgetExists(Id(:pcmcia)) || UI.WidgetExists(Id(:usb)) if UI.QueryWidget(Id(:pcmcia), :Value) == true Ops.set(@hardware, "hotplug", "pcmcia") @@ -608,11 +609,11 @@ end Builtins.y2debug("hotplug=%1", Ops.get_string(@hardware, "hotplug", "")) - if UI.WidgetExists(Id(:dev)) + if UI.WidgetExists(Id(:type)) Ops.set( @hardware, "type", - Convert.to_string(UI.QueryWidget(Id(:dev), :Value)) + Convert.to_string(UI.QueryWidget(Id(:type), :Value)) ) Ops.set( @hardware, @@ -623,9 +624,11 @@ ) ) UI.ChangeWidget( - Id(:num), + Id(:ifcfg_name), :Items, - LanItems.FreeDevices(Ops.get_string(@hardware, "realtype", "")) + LanItems.FreeDevices(@hardware["realtype"]).map do |index| + @hardware["realtype"] + index + end ) end Builtins.y2debug("type=%1", Ops.get_string(@hardware, "type", "")) @@ -687,7 +690,7 @@ Ops.set( @hardware, "device", - Convert.to_string(UI.QueryWidget(Id(:num), :Value)) + Convert.to_string(UI.QueryWidget(Id(:ifcfg_name), :Value)) ) if Ops.get_string(@hardware, "device", "") != "bus-usb" && Ops.get_string(@hardware, "device", "") != "bus-pcmcia" @@ -711,7 +714,7 @@ end UI.ChangeWidget( - Id(:num), + Id(:ifcfg_name), :Value, Ops.get_string(@hardware, "device", "") ) @@ -803,38 +806,40 @@ nil end + def devname_from_hw_dialog + UI.QueryWidget(Id(:ifcfg_name), :Value) + end + + def validate_hw(key, event) + nm = devname_from_hw_dialog + + if UsedNicName(nm) + Popup.Error( + Builtins.sformat( + _( + "Configuration name %1 already exists.\nChoose a different one." + ), + nm + ) + ) + UI.SetFocus(Id(:ifcfg_name)) + + return false + end + + return true + end + def storeHW(key, event) - event = deep_copy(event) if isNewDevice - LanItems.type = Convert.to_string(UI.QueryWidget(Id(:dev), :Value)) - nm = Builtins.sformat( - "%1%2", - LanItems.type, - Convert.to_string(UI.QueryWidget(Id(:num), :Value)) - ) - #Remember current device number (#308763) - # see also bnc#391802 - LanItems.device = IsNotEmpty(LanItems.device) ? - Convert.to_string(UI.QueryWidget(Id(:num), :Value)) : - nm - - if Builtins.contains(NetworkInterfaces.List(""), nm) - Popup.Error( - Builtins.sformat( - _( - "Configuration name %1 already exists.\nChoose a different one." - ), - nm - ) - ) - UI.SetFocus(Id(:num)) - end + nm = devname_from_hw_dialog + LanItems.type = UI.QueryWidget(Id(:type), :Value) NetworkInterfaces.Name = nm Ops.set(LanItems.Items, [LanItems.current, "ifcfg"], nm) - #Initialize udev map, so that setDriver (see below) sets correct module + # Initialize udev map, so that setDriver (see below) sets correct module Ops.set(LanItems.Items, [LanItems.current, "udev"], {}) - #FIXME: for interfaces with no hwinfo don't propose ifplugd + # FIXME: for interfaces with no hwinfo don't propose ifplugd if Builtins.size(Ops.get_map(LanItems.getCurrentItem, "hwinfo", {})) == 0 Builtins.y2milestone( "interface without hwinfo, proposing STARTMODE=auto" @@ -842,7 +847,8 @@ LanItems.startmode = "auto" end if LanItems.type == "vlan" - LanItems.vlan_id = Convert.to_string(UI.QueryWidget(Id(:num), :Value)) + # for vlan devices named vlanN pre-set vlan_id to N, otherwise default to 0 + LanItems.vlan_id = "#{nm["vlan".size].to_i}" end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.93/src/include/network/routines.rb new/yast2-network-3.1.95/src/include/network/routines.rb --- old/yast2-network-3.1.93/src/include/network/routines.rb 2014-09-04 12:53:09.000000000 +0200 +++ new/yast2-network-3.1.95/src/include/network/routines.rb 2014-09-08 11:13:24.000000000 +0200 @@ -510,7 +510,7 @@ true end - # Checks if given nic name is used already. + # Checks if device with the given name is configured already. def UsedNicName(name) Builtins.contains(NetworkInterfaces.List(""), name) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.93/src/lib/network/edit_nic_name.rb new/yast2-network-3.1.95/src/lib/network/edit_nic_name.rb --- old/yast2-network-3.1.93/src/lib/network/edit_nic_name.rb 2014-09-04 12:53:09.000000000 +0200 +++ new/yast2-network-3.1.95/src/lib/network/edit_nic_name.rb 2014-09-08 11:13:24.000000000 +0200 @@ -149,7 +149,7 @@ # @return [boolean] false if name is invalid def CheckUdevNicName(name) # check if the name is assigned to another device already - if UsedNicName(name) && name != LanItems.GetCurrentName + if LanItems.GetNetcardNames.include?(name) && name != LanItems.GetCurrentName Popup.Error(_("Configuration name already exists.")) return false end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.93/src/modules/LanItems.rb new/yast2-network-3.1.95/src/modules/LanItems.rb --- old/yast2-network-3.1.93/src/modules/LanItems.rb 2014-09-04 12:53:09.000000000 +0200 +++ new/yast2-network-3.1.95/src/modules/LanItems.rb 2014-09-08 11:13:24.000000000 +0200 @@ -937,7 +937,7 @@ @Items.keys end - # Creates list of names of all known netcards + # Creates list of names of all known netcards configured even unconfigured def GetNetcardNames GetDeviceNames( GetNetcardInterfaces()) end @@ -1879,7 +1879,7 @@ # FIXME: encapsulate into LanItems.GetItemType ? @type = Ops.get_string(@Items, [@current, "hwinfo", "type"], "eth") - @device = NetworkInterfaces.GetFreeDevice(@type) + @device = @type + NetworkInterfaces.GetFreeDevice(@type) # TODO: instead of udev use hwinfo dev_name NetworkInterfaces.Name = GetItemUdev("NAME") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.93/test/edit_nic_name_test.rb new/yast2-network-3.1.95/test/edit_nic_name_test.rb --- old/yast2-network-3.1.93/test/edit_nic_name_test.rb 2014-09-04 12:53:09.000000000 +0200 +++ new/yast2-network-3.1.95/test/edit_nic_name_test.rb 2014-09-08 11:13:24.000000000 +0200 @@ -11,6 +11,7 @@ CURRENT_NAME = "spec0" NEW_NAME = "new1" + EXISTING_NEW_NAME = "existing_new_name" describe '#run' do @@ -33,7 +34,10 @@ # create the dialog @edit_name_dlg = EditNicName.new - @edit_name_dlg.stub( :UsedNicName) { false } + + allow(LanItems) + .to receive(:GetNetcardNames) + .and_return([CURRENT_NAME]) end context 'when closed without any change' do @@ -75,6 +79,33 @@ expect( @edit_name_dlg.run).to be_equal CURRENT_NAME end + + it 'asks for new user input when name already exists' do + allow(UI) + .to receive(:QueryWidget) + .with(:dev_name, :Value) + .and_return(EXISTING_NEW_NAME, NEW_NAME) + allow(UI) + .to receive(:UserInput) + .and_return(:ok) + + expect(@edit_name_dlg) + .to receive(:CheckUdevNicName) + .with(EXISTING_NEW_NAME) + .and_return(false) + expect(@edit_name_dlg) + .to receive(:CheckUdevNicName) + .with(NEW_NAME) + .and_return(true) + + expect(UI) + .to receive(:SetFocus) + expect(LanItems) + .to receive(:rename) + .with(NEW_NAME) + + expect(@edit_name_dlg.run).to eql NEW_NAME + end end end end -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org