Hello community,
here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2018-11-01 19:09:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-network (Old)
and /work/SRC/openSUSE:Factory/.yast2-network.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network"
Thu Nov 1 19:09:24 2018 rev:393 rq:645685 version:4.1.15
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2018-09-04 22:50:51.463909529 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2018-11-01 19:09:26.250032826 +0100
@@ -1,0 +2,72 @@
+Wed Oct 31 08:37:13 UTC 2018 - mfilka@suse.com
+
+- bnc#1111925
+ - always propose wpa_supplicant when configuring wlan
+- bsc#1113080
+ - Fix detection of peap mode (jreidinger@suse.com)
+- Propose most commonly used setup for WPA by default
+- 4.1.15
+
+-------------------------------------------------------------------
+Wed Oct 24 13:12:33 UTC 2018 - jreidinger@suse.com
+
+- Fix detection of peap mode (bsc#1113080)
+- 4.1.14
+
+-------------------------------------------------------------------
+Tue Oct 16 19:29:30 UTC 2018 - knut.anderssen@suse.com
+
+- Simplified the installation network proposal collecting all the
+ configured dhcp interfaces in a single entry (fate#326480)
+- 4.1.13
+
+-------------------------------------------------------------------
+Tue Oct 16 09:02:26 UTC 2018 - mfilka@suse.com
+
+- bsc#1110598
+ - fixed path to license file
+- 4.1.12
+
+-------------------------------------------------------------------
+Mon Oct 15 08:38:58 UTC 2018 - mfilka@suse.com
+
+- fate#323454
+ - wicked compatible parsing of NTP servers from dhcp leases
+- 4.1.11
+
+-------------------------------------------------------------------
+Thu Oct 4 21:46:23 UTC 2018 - knut.anderssen@suse.com
+
+- Fixes to the networking AY schema (bsc#1108852)
+ - Added missed s390 device 'layer2' boolean element.
+- 4.1.10
+
+-------------------------------------------------------------------
+Wed Oct 3 07:33:01 UTC 2018 - mfilka@suse.com
+
+- bnc#1105230
+ - do not crash with internal error when 0.0.0.0 netmask is used
+ in the routing tab
+- Activate s390 network devices before applying udev naming rules,
+ avoiding "Invalid key/value pair in
+ /etc/udev/rules.d/70-persistent-net.rules" (bsc#1095761)
+ (by mvidner@suse.com)
+- 4.1.9
+
+-------------------------------------------------------------------
+Tue Oct 2 19:59:14 UTC 2018 - mfilka@suse.com
+
+- bnc#1109312
+ - fixed internal error (replaced calls to LanItems::FreeDevices
+ which was removed)
+- 4.1.8
+
+-------------------------------------------------------------------
+Tue Sep 18 07:31:10 UTC 2018 - mfilka@suse.com
+
+- bnc#964856
+ - adapted to changes in NetworkInterfaces API
+ - GetFreeDevice and GetFreeDevices was dropped
+- 4.1.7
+
+-------------------------------------------------------------------
Old:
----
yast2-network-4.1.6.tar.bz2
New:
----
yast2-network-4.1.15.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.Xbp1zh/_old 2018-11-01 19:09:26.742032852 +0100
+++ /var/tmp/diff_new_pack.Xbp1zh/_new 2018-11-01 19:09:26.746032852 +0100
@@ -17,7 +17,7 @@
Name: yast2-network
-Version: 4.1.6
+Version: 4.1.15
Release: 0
BuildArch: noarch
@@ -107,7 +107,7 @@
%dir %{yast_docdir}
%doc %{yast_docdir}/CONTRIBUTING.md
-%license %{yast_docdir}/COPYING
+%license COPYING
%doc %{yast_docdir}/README.md
%changelog
++++++ yast2-network-4.1.6.tar.bz2 -> yast2-network-4.1.15.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/doc/Makefile.am new/yast2-network-4.1.15/doc/Makefile.am
--- old/yast2-network-4.1.6/doc/Makefile.am 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/doc/Makefile.am 1970-01-01 01:00:00.000000000 +0100
@@ -1,12 +0,0 @@
-#
-# Makefile.am for y2c_network/doc
-#
-
-SUBDIRS = autodocs
-
-htmldir = $(docdir)
-
-doc_DATA = autoinst
-html_DATA = devices.html
-
-EXTRA_DIST = $(doc_DATA) $(html_DATA)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/package/yast2-network.changes new/yast2-network-4.1.15/package/yast2-network.changes
--- old/yast2-network-4.1.6/package/yast2-network.changes 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/package/yast2-network.changes 2018-10-31 10:03:07.000000000 +0100
@@ -1,4 +1,76 @@
-------------------------------------------------------------------
+Wed Oct 31 08:37:13 UTC 2018 - mfilka@suse.com
+
+- bnc#1111925
+ - always propose wpa_supplicant when configuring wlan
+- bsc#1113080
+ - Fix detection of peap mode (jreidinger@suse.com)
+- Propose most commonly used setup for WPA by default
+- 4.1.15
+
+-------------------------------------------------------------------
+Wed Oct 24 13:12:33 UTC 2018 - jreidinger@suse.com
+
+- Fix detection of peap mode (bsc#1113080)
+- 4.1.14
+
+-------------------------------------------------------------------
+Tue Oct 16 19:29:30 UTC 2018 - knut.anderssen@suse.com
+
+- Simplified the installation network proposal collecting all the
+ configured dhcp interfaces in a single entry (fate#326480)
+- 4.1.13
+
+-------------------------------------------------------------------
+Tue Oct 16 09:02:26 UTC 2018 - mfilka@suse.com
+
+- bsc#1110598
+ - fixed path to license file
+- 4.1.12
+
+-------------------------------------------------------------------
+Mon Oct 15 08:38:58 UTC 2018 - mfilka@suse.com
+
+- fate#323454
+ - wicked compatible parsing of NTP servers from dhcp leases
+- 4.1.11
+
+-------------------------------------------------------------------
+Thu Oct 4 21:46:23 UTC 2018 - knut.anderssen@suse.com
+
+- Fixes to the networking AY schema (bsc#1108852)
+ - Added missed s390 device 'layer2' boolean element.
+- 4.1.10
+
+-------------------------------------------------------------------
+Wed Oct 3 07:33:01 UTC 2018 - mfilka@suse.com
+
+- bnc#1105230
+ - do not crash with internal error when 0.0.0.0 netmask is used
+ in the routing tab
+- Activate s390 network devices before applying udev naming rules,
+ avoiding "Invalid key/value pair in
+ /etc/udev/rules.d/70-persistent-net.rules" (bsc#1095761)
+ (by mvidner@suse.com)
+- 4.1.9
+
+-------------------------------------------------------------------
+Tue Oct 2 19:59:14 UTC 2018 - mfilka@suse.com
+
+- bnc#1109312
+ - fixed internal error (replaced calls to LanItems::FreeDevices
+ which was removed)
+- 4.1.8
+
+-------------------------------------------------------------------
+Tue Sep 18 07:31:10 UTC 2018 - mfilka@suse.com
+
+- bnc#964856
+ - adapted to changes in NetworkInterfaces API
+ - GetFreeDevice and GetFreeDevices was dropped
+- 4.1.7
+
+-------------------------------------------------------------------
Wed Aug 22 07:19:45 UTC 2018 - dgonzalez@suse.com
- Update calls to YaST2 systemd classes (related to fate#319428)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/package/yast2-network.spec new/yast2-network-4.1.15/package/yast2-network.spec
--- old/yast2-network-4.1.6/package/yast2-network.spec 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/package/yast2-network.spec 2018-10-31 10:03:07.000000000 +0100
@@ -17,7 +17,7 @@
Name: yast2-network
-Version: 4.1.6
+Version: 4.1.15
Release: 0
BuildArch: noarch
@@ -107,7 +107,7 @@
%dir %{yast_docdir}
%doc %{yast_docdir}/CONTRIBUTING.md
-%license %{yast_docdir}/COPYING
+%license COPYING
%doc %{yast_docdir}/README.md
%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/autoyast-rnc/networking.rnc new/yast2-network-4.1.15/src/autoyast-rnc/networking.rnc
--- old/yast2-network-4.1.6/src/autoyast-rnc/networking.rnc 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/autoyast-rnc/networking.rnc 2018-10-31 10:03:07.000000000 +0100
@@ -98,6 +98,7 @@
device =
element (device | listentry) {
element type { text }? &
+ element layer2 { BOOLEAN}? &
element chanids { text }? &
element portname { text }? &
element protocol { text }? &
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/clients/host_auto.rb new/yast2-network-4.1.15/src/clients/host_auto.rb
--- old/yast2-network-4.1.6/src/clients/host_auto.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/clients/host_auto.rb 2018-10-31 10:03:07.000000000 +0100
@@ -145,7 +145,7 @@
# Semantic AutoYaST profile check
#
# Problems will be stored in AutoInstall.issues_list.
- # @param [Hash] input autoyast settings
+ # @param imported_hosts [Hash] autoyast settings
def check_profile_for_errors(imported_hosts)
# Checking for empty hostnames
imported_hosts.each do |ip, hosts|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/clients/lan_auto.rb new/yast2-network-4.1.15/src/clients/lan_auto.rb
--- old/yast2-network-4.1.6/src/clients/lan_auto.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/clients/lan_auto.rb 2018-10-31 10:03:07.000000000 +0100
@@ -59,7 +59,7 @@
Builtins.y2milestone("Lan autoinst callback: #{@func}")
if @func == "Summary"
- @ret = Ops.get_string(Lan.Summary("summary"), 0, "")
+ @ret = Lan.Summary("summary")
elsif @func == "Reset"
Lan.Import({})
@ret = {}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/data/network/sysconfig_defaults.yml new/yast2-network-4.1.15/src/data/network/sysconfig_defaults.yml
--- old/yast2-network-4.1.6/src/data/network/sysconfig_defaults.yml 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/data/network/sysconfig_defaults.yml 2018-10-31 10:03:07.000000000 +0100
@@ -27,7 +27,7 @@
WIRELESS_BITRATE: auto
WIRELESS_AP: ''
WIRELESS_POWER: ''
-WIRELESS_EAP_MODE: ''
+WIRELESS_EAP_MODE: 'PEAP'
WIRELESS_WPA_IDENTITY: ''
WIRELESS_WPA_PASSWORD: ''
WIRELESS_WPA_ANONID: ''
@@ -35,7 +35,7 @@
WIRELESS_CLIENT_KEY: ''
WIRELESS_CLIENT_KEY_PASSWORD: ''
WIRELESS_CA_CERT: ''
-WIRELESS_EAP_AUTH: ''
+WIRELESS_EAP_AUTH: 'MSCHAPV2'
WIRELESS_PEAP_VERSION: ''
WIRELESS_AP_SCANMODE: '1'
BONDING_MODULE_OPTS: mode=active-backup miimon=100
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/include/network/lan/hardware.rb new/yast2-network-4.1.15/src/include/network/lan/hardware.rb
--- old/yast2-network-4.1.6/src/include/network/lan/hardware.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/include/network/lan/hardware.rb 2018-10-31 10:03:07.000000000 +0100
@@ -33,6 +33,9 @@
module Yast
module NetworkLanHardwareInclude
+ # how many device names is proposed in Hardware dialog
+ NEW_DEVICES_COUNT = 10
+
def initialize_network_lan_hardware(include_target)
Yast.import "UI"
@@ -240,24 +243,8 @@
Builtins.y2milestone("hotplug=%1", LanItems.hotplug)
- Ops.set(
- @hardware,
- "devices",
- LanItems.FreeDevices(Ops.get_string(@hardware, "realtype", ""))
- ) # TODO: id-, bus-, ... here
- if !Builtins.contains(
- Ops.get_list(@hardware, "devices", []),
- Ops.get_string(@hardware, "device", "")
- )
- Ops.set(
- @hardware,
- "devices",
- Builtins.prepend(
- Ops.get_list(@hardware, "devices", []),
- Ops.get_string(@hardware, "device", "")
- )
- )
- end
+ # list of free device names when e.g. adding new device
+ @hardware["devices"] = LanItems.new_type_devices(@hardware["realtype"], NEW_DEVICES_COUNT)
Ops.set(
@hardware,
@@ -344,7 +331,7 @@
Id(:ifcfg_name),
Opt(:editable, :hstretch),
_("&Configuration Name"),
- [@hardware["device"] || ""]
+ @hardware["devices"]
)
)
@@ -612,9 +599,7 @@
UI.ChangeWidget(
Id(:ifcfg_name),
:Items,
- LanItems.FreeDevices(@hardware["realtype"]).map do |index|
- @hardware["realtype"] + index
- end
+ LanItems.new_type_devices(@hardware["realtype"], NEW_DEVICES_COUNT)
)
end
Builtins.y2debug("type=%1", Ops.get_string(@hardware, "type", ""))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/include/network/lan/wireless.rb new/yast2-network-4.1.15/src/include/network/lan/wireless.rb
--- old/yast2-network-4.1.6/src/include/network/lan/wireless.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/include/network/lan/wireless.rb 2018-10-31 10:03:07.000000000 +0100
@@ -76,11 +76,11 @@
"opt" => [:notify],
"items" => [
# combo box item, one of WPA EAP modes
- ["TTLS", _("TTLS")],
- # combo box item, one of WPA EAP modes
["PEAP", _("PEAP")],
# combo box item, one of WPA EAP modes
- ["TLS", _("TLS")]
+ ["TLS", _("TLS")],
+ # combo box item, one of WPA EAP modes
+ ["TTLS", _("TTLS")]
],
"help" => _(
"<p>WPA-EAP uses a RADIUS server to authenticate users. There\n" \
@@ -1182,7 +1182,7 @@
InitializeWidget(key)
# enable/disable
mode = Ops.get_string(LanItems.wl_wpa_eap, "WPA_EAP_MODE", "")
- UI.ChangeWidget(Id(key), :Enabled, mode == "peap")
+ UI.ChangeWidget(Id(key), :Enabled, mode.casecmp("peap").zero?)
nil
end
@@ -1350,9 +1350,7 @@
auth_names = {
# combo box item, any of EAP authentication methods
- "" => _(
- "Any"
- ),
+ "" => _("Any"),
# combo box item, an EAP authentication method
"MD5" => _("MD5"),
# combo box item, an EAP authentication method
@@ -1362,13 +1360,9 @@
# combo box item, an EAP authentication method
"PAP" => _("PAP"),
# combo box item, an EAP authentication method
- "MSCHAP" => _(
- "MSCHAPv1"
- ),
+ "MSCHAP" => _("MSCHAPv1"),
# combo box item, an EAP authentication method
- "MSCHAPV2" => _(
- "MSCHAPv2"
- )
+ "MSCHAPV2" => _("MSCHAPv2")
}
auth_items = {
"TTLS" => ["", "MD5", "GTC", "CHAP", "PAP", "MSCHAP", "MSCHAPV2"],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/include/network/services/routing.rb new/yast2-network-4.1.15/src/include/network/services/routing.rb
--- old/yast2-network-4.1.6/src/include/network/services/routing.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/include/network/services/routing.rb 2018-10-31 10:03:07.000000000 +0100
@@ -222,7 +222,7 @@
end
route = Builtins.add(route, val)
val = Convert.to_string(UI.QueryWidget(Id(:genmask), :Value))
- if val != "-" && val != "0.0.0.0" && !valid_netmask?(val)
+ if val != "-" && !valid_netmask?(val)
# Popup::Error text
Popup.Error(_("Subnetmask is invalid."))
UI.SetFocus(Id(:genmask))
@@ -379,9 +379,19 @@
nil
end
+ # Checks if the param is valid IPv4 / IPv6
+ #
+ # @param gw [String] IPv4 or IPv6 address
+ # @return [Bolean] true if given param is valid
+ def valid_gateway?(gw)
+ !gw.nil? && (gw.empty? || IP.Check(gw))
+ end
+
+ # An input validator for the Routing dialog
def validateRouting(_key, _event)
gw = UI.QueryWidget(Id(:gw), :Value)
- return true if gw == "" || IP.Check(gw)
+
+ return true if valid_gateway?(gw)
Popup.Error(_("The default gateway is invalid."))
UI.SetFocus(Id(:gw))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/lib/network/clients/network_proposal.rb new/yast2-network-4.1.15/src/lib/network/clients/network_proposal.rb
--- old/yast2-network-4.1.6/src/lib/network/clients/network_proposal.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/lib/network/clients/network_proposal.rb 2018-10-31 10:03:07.000000000 +0100
@@ -24,7 +24,7 @@
def make_proposal(_)
{
- "preformatted_proposal" => Yast::Lan.Summary("summary").first,
+ "preformatted_proposal" => Yast::Lan.Summary("proposal"),
"label_proposal" => [Yast::LanItems.summary("one_line")]
}
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/lib/network/lan_items_summary.rb new/yast2-network-4.1.15/src/lib/network/lan_items_summary.rb
--- old/yast2-network-4.1.6/src/lib/network/lan_items_summary.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/lib/network/lan_items_summary.rb 2018-10-31 10:03:07.000000000 +0100
@@ -56,6 +56,29 @@
Summary.DevicesList(items)
end
+ # Generates a summary in RichText format for the configured interfaces
+ #
+ # @example
+ # LanItemsSummary.new.proposal
+ # => "<ul><li><p>Configured with DHCP: eth0, eth1<br></p></li>" \
+ # "<li><p>br0 (Bridge)<br>IP address: 192.168.122.60/24" \
+ # "<br>Bridge Ports: eth2 eth3</p></li></ul>"
+ #
+ # @see Summary
+ # @return [String] summary in RichText
+ def proposal
+ items = []
+
+ items << "<li>#{dhcp_summary}</li>" unless LanItems.find_dhcp_ifaces.empty?
+ items << "<li>#{static_summary}</li>" unless LanItems.find_static_ifaces.empty?
+ items << "<li>#{bridge_summary}</li>" unless bridges.empty?
+ items << "<li>#{bonding_summary}</li>" unless bonds.empty?
+
+ return Summary.NotConfigured if items.empty?
+
+ Summary.DevicesList(items)
+ end
+
# Generates a one line text summary for the configured interfaces.
#
# @example with one configured interface
@@ -109,5 +132,49 @@
LanItems.DeviceProtocol(ifcfg)
end
end
+
+ # Return a summary of the interfaces configurew with DHCP
+ #
+ # @return [String] interfaces configured with DHCP summary
+ def dhcp_summary
+ # TRANSLATORS: %s is the list of interfaces configured by DHCP
+ _("Configured with DHCP: %s") % LanItems.find_dhcp_ifaces.sort.join(", ")
+ end
+
+ # Return a summary of the interfaces configured statically
+ #
+ # @return [String] statically configured interfaces summary
+ def static_summary
+ # TRANSLATORS: %s is the list of interfaces configured by DHCP
+ _("Statically configured: %s") % LanItems.find_static_ifaces.sort.join(", ")
+ end
+
+ # Return a summary of the configured bridge interfaces
+ #
+ # @return [String] bridge configured interfaces summary
+ def bridge_summary
+ _("Bridges: %s") % bridges.map { |n| "#{n} (#{LanItems.bridge_slaves(n).sort.join(", ")})" }
+ end
+
+ # Return a summary of the configured bonding interfaces
+ #
+ # @return [String] bonding configured interfaces summary
+ def bonding_summary
+ _("Bonds: %s") % bonds.map { |n| "#{n} (#{LanItems.GetBondSlaves(n).sort.join(", ")})" }
+ end
+
+ # Convenience method that obtains the list of bonding configured interfaces
+ #
+ # @return [Array<String>] bonding configured interface names
+ def bonds
+ LanItems.getNetworkInterfaces("bond").sort
+ end
+
+ # Convenience method that obtains the list of bridge configured interfaces
+ #
+ # @return [Array<String>] bridge configured interface names
+ def bridges
+ LanItems.getNetworkInterfaces("br").sort
+ end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/lib/network/network_autoyast.rb new/yast2-network-4.1.15/src/lib/network/network_autoyast.rb
--- old/yast2-network-4.1.6/src/lib/network/network_autoyast.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/lib/network/network_autoyast.rb 2018-10-31 10:03:07.000000000 +0100
@@ -17,6 +17,7 @@
def initialize
# import has to be done here, there are some collisions otherwise
+ Yast.import "Arch"
Yast.import "Lan"
Yast.import "LanItems"
Yast.import "Linuxrc"
@@ -72,6 +73,10 @@
no_rules &&= ex_udev_rules.empty?
return if no_rules
+ # for the purpose of setting the persistent names, create the devices 1st
+ s390_devices = ay_networking_section.fetch("s390-devices", {})
+ s390_devices.each { |rule| LanItems.createS390Device(rule) } if Arch.s390
+
LanItems.Read
# implicitly defined udev rules are overwritten by explicit ones in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/lib/network/wicked.rb new/yast2-network-4.1.15/src/lib/network/wicked.rb
--- old/yast2-network-4.1.6/src/lib/network/wicked.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/lib/network/wicked.rb 2018-10-31 10:03:07.000000000 +0100
@@ -16,5 +16,21 @@
SCR.Execute(BASH_PATH, "wicked ifreload #{devs.join(" ")}").zero?
end
+
+ # Parses wicked runtime configuration and returns list of ntp servers
+ #
+ # @param iface [String] network device
+ # @return [Array<String>] list of NTP servers
+ def parse_ntp_servers(iface)
+ raise ArgumentError, "A network device has to be specified" if iface.nil? || iface.empty?
+ raise "Parsing NTP Servers not supported for network service in use" if !NetworkService.is_wicked
+
+ lease_files = ["ipv4", "ipv6"].map { |ip| "/var/lib/wicked/lease-#{iface}-dhcp-#{ip}.xml" }
+ lease_files.find_all { |f| File.file?(f) }.reduce([]) do |stack, file|
+ result = SCR.Execute(path(".target.bash_output"), "wicked xpath --file #{file} \"%{//ntp/server}\"")
+
+ stack + result.fetch("stdout", "").split("\n")
+ end
+ end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/modules/Lan.rb new/yast2-network-4.1.15/src/modules/Lan.rb
--- old/yast2-network-4.1.6/src/modules/Lan.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/modules/Lan.rb 2018-10-31 10:03:07.000000000 +0100
@@ -794,26 +794,18 @@
end
# Create a textual summary and a list of unconfigured devices
- # @param [String] mode "split": split configured and unconfigured?<br />
- # "summary": add resolver and routing symmary,
- # "proposal": for proposal, add links for direct config
+ # @param [String] mode "summary": add resolver and routing summary,
+ # "proposal": for proposal also with resolver an routing summary
# @return summary of the current configuration
def Summary(mode)
- sum = LanItems.BuildLanOverview
-
- # Testing improved summary
- if mode == "summary"
- Ops.set(
- sum,
- 0,
- Ops.add(
- Ops.add(Ops.get_string(sum, 0, ""), DNS.Summary),
- Routing.Summary
- )
- )
+ case mode
+ when "summary"
+ "#{LanItems.BuildLanOverview.first}#{DNS.Summary}#{Routing.Summary}"
+ when "proposal"
+ "#{LanItems.summary(:proposal)}#{DNS.Summary}#{Routing.Summary}"
+ else
+ LanItems.BuildLanOverview.first
end
-
- deep_copy(sum)
end
# Create a textual summary for the general network settings
@@ -948,7 +940,7 @@
# then each configuration (except bridges) move to the bridge
# and add old device name into bridge_ports
LanItems.Items.each do |current, config|
- bridge_name = format("br%s", NetworkInterfaces.GetFreeDevice("br"))
+ bridge_name = LanItems.new_type_device("br")
next unless connected_and_bridgeable?(bridge_name, current, config)
LanItems.current = current
# first configure all connected unconfigured devices with dhcp (with default parameters)
@@ -972,9 +964,8 @@
if NetworkService.is_network_manager
pkgs << "NetworkManager" if !PackageSystem.Installed("NetworkManager")
elsif !PackageSystem.Installed("wpa_supplicant")
- # we have to add wpa_supplicant when wpa is in game, wicked relies on it
- pkgs << "wpa_supplicant" if !NetworkInterfaces.Locate("WIRELESS_AUTH_MODE", "psk").empty?
- pkgs << "wpa_supplicant" if !NetworkInterfaces.Locate("WIRELESS_AUTH_MODE", "eap").empty?
+ # we have to add wpa_supplicant when wlan is in game, wicked relies on it
+ pkgs << "wpa_supplicant" if !LanItems.find_type_ifaces("wlan").empty?
end
pkgs.uniq!
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/modules/LanItems.rb new/yast2-network-4.1.15/src/modules/LanItems.rb
--- old/yast2-network-4.1.6/src/modules/LanItems.rb 2018-08-23 18:01:38.000000000 +0200
+++ new/yast2-network-4.1.15/src/modules/LanItems.rb 2018-10-31 10:03:07.000000000 +0100
@@ -931,6 +931,18 @@
GetDeviceNames(GetNetcardInterfaces())
end
+ # Finds all items of given device type
+ #
+ # @param type [String] device type
+ # @return [Array] list of device names
+ def find_type_ifaces(type)
+ items = GetNetcardInterfaces().select do |iface|
+ GetDeviceType(iface) == type
+ end
+
+ GetDeviceNames(items)
+ end
+
# Finds all NICs configured with DHCP
#
# @return [Array<String>] list of NIC names which are configured to use (any) dhcp
@@ -940,6 +952,15 @@
end
end
+ # Find all NICs configured statically
+ #
+ # @return [Array<String>] list of NIC names which have a static config
+ def find_static_ifaces
+ find_by_sysconfig do |ifcfg|
+ ifcfg.fetch("BOOTPROTO", "").match(/static/i)
+ end
+ end
+
# Finds all devices which has DHCLIENT_SET_HOSTNAME set to "yes"
#
# @return [Array<String>] list of NIC names which has the option set to "yes"
@@ -971,14 +992,15 @@
# Get list of all configured interfaces
#
+ # @param type [String] only obtains configured interfaces of the given type
# return [Array] list of strings - interface names (eth0, ...)
# FIXME: rename e.g. to configured_interfaces
- def getNetworkInterfaces
+ def getNetworkInterfaces(type = nil)
configurations = NetworkInterfaces.FilterDevices("netcard")
- devtypes = NetworkInterfaces.CardRegex["netcard"].to_s.split("|")
+ devtypes = type ? [type] : NetworkInterfaces.CardRegex["netcard"].to_s.split("|")
- devtypes.inject([]) do |acc, type|
- conf = configurations[type].to_h
+ devtypes.inject([]) do |acc, conf_type|
+ conf = configurations[conf_type].to_h
acc.concat(conf.keys)
end
end
@@ -1667,13 +1689,6 @@
#-------------------
# PRIVATE FUNCTIONS
- # Return 10 free devices
- # @param [String] type device type
- # @return [Array] of 10 free devices
- def FreeDevices(type)
- NetworkInterfaces.GetFreeDevices(type, 10)
- end
-
def SetDefaultsForHW
Builtins.y2milestone("SetDefaultsForHW type %1", @type)
@mtu = "1492" if Arch.s390 && Builtins.contains(["lcs", "eth"], @type)
@@ -1868,7 +1883,7 @@
# FIXME: encapsulate into LanItems.GetItemType ?
@type = Ops.get_string(@Items, [@current, "hwinfo", "type"], "eth")
- @device = @type + NetworkInterfaces.GetFreeDevice(@type)
+ @device = new_type_device(@type)
# TODO: instead of udev use hwinfo dev_name
NetworkInterfaces.Name = GetItemUdev("NAME")
@@ -2530,6 +2545,52 @@
ret
end
+ # Returns unused name for device of given type
+ #
+ # When already having eth0, eth1, enp0s3 devices (eth type) and asks for new
+ # device of eth type it will e.g. return eth2 as a free name.
+ #
+ # Method always returns name in the oldfashioned schema (eth0, br1, ...)
+ #
+ # @raise [ArgumentError] when type is nil or empty
+ # @param type [String] device type
+ # @return [String] available device name
+ def new_type_device(type)
+ new_type_devices(type, 1).first
+ end
+
+ # Returns a list of unused names for devices of given type
+ #
+ # Also @see new_type_device
+ #
+ # @raise [ArgumentError] when type is nil or empty
+ # @param type [String] device type
+ # @param count [Integer] requested count of names
+ # @return [Array<String>] list of free names, empty if count is < 1
+ def new_type_devices(type, count)
+ raise ArgumentError, "Valid device type expected" if type.nil? || type.empty?
+ return [] if count < 1
+
+ known_devs = find_type_ifaces(type)
+
+ candidates = (0..known_devs.size + count - 1).map { |c| "#{type}#{c}" }
+
+ (candidates - known_devs)[0..count - 1]
+ end
+
+ # Returns hash of NTP servers
+ #
+ # Provides map with NTP servers obtained via any of dhcp aware interfaces
+ #
+ # @return [Hash