Hello community,

here is the log from the commit of package yast2-network for openSUSE:Factory 
checked in at 2019-09-23 13:15:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-network (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-network.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-network"

Mon Sep 23 13:15:49 2019 rev:409 rq:730364 version:4.2.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes      
2019-07-31 14:26:52.494245841 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-network.new.7948/yast2-network.changes    
2019-09-23 13:15:50.449121935 +0200
@@ -1,0 +2,12 @@
+Tue Sep 10 07:40:04 UTC 2019 - Michal Filka <[email protected]>
+
+- bnc#1149234
+  - apply udev rule from AY profile according to device's mac
+    value when permanent_mac is missing in list of the device's
+    options
+- bsc#1133442
+  - Increased the DHCP timeout when NetworkManager is in use to
+    its default (45 seconds).
+- 4.2.12
+
+-------------------------------------------------------------------

Old:
----
  yast2-network-4.2.11.tar.bz2

New:
----
  yast2-network-4.2.12.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.6EZJ9K/_old  2019-09-23 13:15:50.865121861 +0200
+++ /var/tmp/diff_new_pack.6EZJ9K/_new  2019-09-23 13:15:50.865121861 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.2.11
+Version:        4.2.12
 Release:        0
 Summary:        YaST2 - Network Configuration
 License:        GPL-2.0-only

++++++ yast2-network-4.2.11.tar.bz2 -> yast2-network-4.2.12.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.11/package/yast2-network.changes 
new/yast2-network-4.2.12/package/yast2-network.changes
--- old/yast2-network-4.2.11/package/yast2-network.changes      2019-07-31 
10:03:50.000000000 +0200
+++ new/yast2-network-4.2.12/package/yast2-network.changes      2019-09-12 
12:39:31.000000000 +0200
@@ -1,4 +1,16 @@
 -------------------------------------------------------------------
+Tue Sep 10 07:40:04 UTC 2019 - Michal Filka <[email protected]>
+
+- bnc#1149234
+  - apply udev rule from AY profile according to device's mac
+    value when permanent_mac is missing in list of the device's
+    options
+- bsc#1133442
+  - Increased the DHCP timeout when NetworkManager is in use to
+    its default (45 seconds).
+- 4.2.12
+
+-------------------------------------------------------------------
 Tue Jul 30 11:14:04 UTC 2019 - Dominique Leuenberger <[email protected]>
 
 - Requires hostname: there are many places where the module calls
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.11/package/yast2-network.spec 
new/yast2-network-4.2.12/package/yast2-network.spec
--- old/yast2-network-4.2.11/package/yast2-network.spec 2019-07-31 
10:03:50.000000000 +0200
+++ new/yast2-network-4.2.12/package/yast2-network.spec 2019-09-12 
12:39:31.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.2.11
+Version:        4.2.12
 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.2.11/src/lib/network/edit_nic_name.rb 
new/yast2-network-4.2.12/src/lib/network/edit_nic_name.rb
--- old/yast2-network-4.2.11/src/lib/network/edit_nic_name.rb   2019-07-31 
10:03:50.000000000 +0200
+++ new/yast2-network-4.2.12/src/lib/network/edit_nic_name.rb   2019-09-12 
12:39:31.000000000 +0200
@@ -40,7 +40,7 @@
       end
 
       if current_item["hwinfo"]
-        @mac = current_item["hwinfo"]["permanent_mac"]
+        @mac = LanItems.item_mac(LanItems.current)
         @bus_id = current_item["hwinfo"]["busid"]
       else
         @mac = ""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.2.11/src/lib/network/network_autoyast.rb 
new/yast2-network-4.2.12/src/lib/network/network_autoyast.rb
--- old/yast2-network-4.2.11/src/lib/network/network_autoyast.rb        
2019-07-31 10:03:50.000000000 +0200
+++ new/yast2-network-4.2.12/src/lib/network/network_autoyast.rb        
2019-09-12 12:39:31.000000000 +0200
@@ -339,6 +339,8 @@
           # Match also parent busid if exist (bsc#1129012)
           parent_busid = i["hwinfo"]["parent_busid"] || busid
           mac = i["hwinfo"]["permanent_mac"]
+          # use mac if permanent_mac is missing (bsc#1149234)
+          mac = i["hwinfo"]["mac"] if mac.nil? || mac.empty?
 
           [busid, parent_busid, mac].any? { |v| v.casecmp(key).zero? }
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.11/src/modules/Lan.rb 
new/yast2-network-4.2.12/src/modules/Lan.rb
--- old/yast2-network-4.2.11/src/modules/Lan.rb 2019-07-31 10:03:50.000000000 
+0200
+++ new/yast2-network-4.2.12/src/modules/Lan.rb 2019-09-12 12:39:31.000000000 
+0200
@@ -448,6 +448,8 @@
       nil
     end
 
+    NM_DHCP_TIMEOUT = 45
+
     # Update the SCR according to network settings
     # @return true on success
     def Write(gui: true)
@@ -571,7 +573,7 @@
 
       if NetworkService.is_network_manager
         network = false
-        timeout = 15
+        timeout = NM_DHCP_TIMEOUT
         while Ops.greater_than(timeout, 0)
           if NetworkService.isNetworkRunning
             network = true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.11/src/modules/LanItems.rb 
new/yast2-network-4.2.12/src/modules/LanItems.rb
--- old/yast2-network-4.2.11/src/modules/LanItems.rb    2019-07-31 
10:03:50.000000000 +0200
+++ new/yast2-network-4.2.12/src/modules/LanItems.rb    2019-09-12 
12:39:31.000000000 +0200
@@ -359,6 +359,17 @@
       GetLanItem(itemId)["udev"]["net"] = rule
     end
 
+    # Returns item's mac
+    #
+    # hwinfo[permanent_mac] is prefered if exists. hwinfo[mac] is used 
otherwise
+    #
+    # @param item_id [Integer] a key for {#Items}
+    # @return [<String>, nil] mac address or nil
+    def item_mac(item_id)
+      hwinfo = GetLanItem(item_id).fetch("hwinfo", {})
+      hwinfo.fetch("permanent_mac", hwinfo.fetch("mac", nil))
+    end
+
     # Inits item's udev rule to a default one if none is present
     #
     # @param item_id [Integer] a key for {#Items}
@@ -367,7 +378,7 @@
       udev = GetItemUdevRule(item_id)
       return udev if !udev.empty?
 
-      default_mac = GetLanItem(item_id).fetch("hwinfo", {})["permanent_mac"]
+      default_mac = item_mac(item_id)
       raise ArgumentError, "Cannot propose udev rule - NIC not present" if 
!default_mac
 
       default_udev = GetDefaultUdevRule(
@@ -427,7 +438,7 @@
       if IsEmpty(udev_rules)
         udev_rules = GetDefaultUdevRule(
           GetCurrentName(),
-          Ops.get_string(getCurrentItem, ["hwinfo", "permanent_mac"], "")
+          item_mac(@current) || ""
         )
         Builtins.y2milestone(
           "No Udev rules found, creating default: %1",
@@ -482,7 +493,7 @@
         LanItems.ReplaceItemUdev(
           "KERNELS",
           "ATTR{address}",
-          LanItems.getCurrentItem.fetch("hwinfo", {}).fetch("permanent_mac", 
"")
+          item_mac(@current) || ""
         )
       when :bus_id
         # Update or insert the dev_port if the sysfs dev_port attribute is 
present
@@ -925,7 +936,7 @@
 
       hardware.each do |hw|
         hw_dev_name = hw["dev_name"] || ""
-        hw_dev_mac = hw["permanent_mac"] || ""
+        hw_dev_mac = hw["permanent_mac"] || hw["mac"] || ""
         hw_dev_busid = hw["busid"] || ""
 
         case oldname
@@ -1339,11 +1350,11 @@
         conn = HTML.Bold(format("(%s)", _("Not connected"))) if 
!item_hwinfo["link"]
         conn = HTML.Bold(format("(%s)", _("No hwinfo"))) if item_hwinfo.empty?
 
-        mac_dev = HTML.Bold("MAC : ") + item_hwinfo["permanent_mac"].to_s + 
"<br>"
+        mac_dev = HTML.Bold("MAC : ") + item_mac(key).to_s + "<br>"
         bus_id  = HTML.Bold("BusID : ") + item_hwinfo["busid"].to_s + "<br>"
         physical_port_id = HTML.Bold("PhysicalPortID : ") + 
physical_port_id(ifcfg_name) + "<br>"
 
-        rich << " " << conn << "<br>" << mac_dev if 
IsNotEmpty(item_hwinfo["permanent_mac"])
+        rich << " " << conn << "<br>" << mac_dev if IsNotEmpty(item_mac(key))
         rich << bus_id if IsNotEmpty(item_hwinfo["busid"])
         rich << physical_port_id if physical_port_id?(ifcfg_name)
         # display it only if we need it, don't duplicate "ifcfg_name" above
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.2.11/test/network_autoconfiguration_test.rb 
new/yast2-network-4.2.12/test/network_autoconfiguration_test.rb
--- old/yast2-network-4.2.11/test/network_autoconfiguration_test.rb     
2019-07-31 10:03:50.000000000 +0200
+++ new/yast2-network-4.2.12/test/network_autoconfiguration_test.rb     
2019-09-12 12:39:31.000000000 +0200
@@ -245,6 +245,11 @@
     context "when the proposal is required" do
       let(:proposal) { true }
 
+      after(:each) do
+        # some methods might have sideeffects - clen them :-/
+        Yast::NetworkInterfaces.Devices.reject! { |k, _| k == "br" }
+      end
+
       it "creates the virtulization proposal config" do
         expect(Yast::Lan).to receive(:ProposeVirtualized).and_call_original
         expect { instance.configure_virtuals }.to change { 
Yast::NetworkInterfaces.Devices.keys.size }.from(1).to(2)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.11/test/network_autoyast_test.rb 
new/yast2-network-4.2.12/test/network_autoyast_test.rb
--- old/yast2-network-4.2.11/test/network_autoyast_test.rb      2019-07-31 
10:03:50.000000000 +0200
+++ new/yast2-network-4.2.12/test/network_autoyast_test.rb      2019-09-12 
12:39:31.000000000 +0200
@@ -446,6 +446,26 @@
         ]
       end
 
+      let(:udev_mac_rules) do
+        [
+          {
+            "name"  => "eth1",
+            "rule"  => "ATTR{address}",
+            "value" => "00:00:00:00:00:00"
+          },
+          {
+            "name"  => "eth3",
+            "rule"  => "ATTR{address}",
+            "value" => "00:00:00:00:00:01"
+          },
+          {
+            "name"  => "eth0",
+            "rule"  => "ATTR{address}",
+            "value" => "00:00:00:00:00:02"
+          }
+        ]
+      end
+
       let(:persistent_udevs) do
         {
           "eth0" => [
@@ -481,7 +501,7 @@
             "dev_name"      => "eth2",
             "busid"         => "0000:01:00.2",
             "mac"           => "00:00:00:00:00:02",
-            "permanent_mac" => "00:00:00:00:00:02"
+            "permanent_mac" => ""
           }
         ]
       end
@@ -501,7 +521,6 @@
           .and_return(persistent_udevs)
 
         Yast::LanItems.Read
-        Yast::LanItems.Items[3] = { "ifcfg" => "eth3" }
       end
 
       # see bnc#1056109
@@ -516,6 +535,8 @@
       # applying of the ruleset we could end with new nameset e.g. <eth2, 
eth0, eth0>
       # which obviously leads to misconfiguration of the system
       it "applies rules so, that names remain unique" do
+        Yast::LanItems.Items[3] = { "ifcfg" => "eth3" }
+
         network_autoyast.send(:assign_udevs_to_devs, udev_rules)
 
         lan_items = Yast::LanItems
@@ -526,6 +547,18 @@
         # check if device names are unique
         expect(names.sort).to eql ["eth0", "eth1", "eth2", "eth3"]
       end
+
+      it "matches devices according to permanent mac or mac field when first 
one is missing" do
+        network_autoyast.send(:assign_udevs_to_devs, udev_mac_rules)
+
+        lan_items = Yast::LanItems
+        names = lan_items.Items.keys.map do |i|
+          lan_items.renamed?(i) ? lan_items.renamed_to(i) : 
lan_items.GetDeviceName(i)
+        end
+
+        # check if device names are unique
+        expect(names.sort).to eql ["eth0", "eth1", "eth3"]
+      end
     end
   end
 


Reply via email to