Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2020-07-21 15:46:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new.3592 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network" Tue Jul 21 15:46:45 2020 rev:428 rq:821504 version:4.3.13 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2020-07-03 00:44:14.969907803 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new.3592/yast2-network.changes 2020-07-21 15:48:33.988160370 +0200 @@ -1,0 +2,15 @@ +Thu Jul 16 08:45:00 UTC 2020 - Knut Anderssen <[email protected]> + +- Permit to write networking config changes without touching the + service and other components like the firewall (bsc#1173298) +- Permit dot characters in the hostname allowing to specify it as + a FQDN (bsc#1173298) +- 4.3.13 + +------------------------------------------------------------------- +Wed Jul 15 15:10:34 UTC 2020 - Josef Reidinger <[email protected]> + +- Do not use Profile.current (bsc#1174173) +- 4.3.12 + +------------------------------------------------------------------- Old: ---- yast2-network-4.3.11.tar.bz2 New: ---- yast2-network-4.3.13.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.NiEooY/_old 2020-07-21 15:48:35.024161651 +0200 +++ /var/tmp/diff_new_pack.NiEooY/_new 2020-07-21 15:48:35.028161656 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.3.11 +Version: 4.3.13 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only @@ -66,6 +66,9 @@ # carrier detection Conflicts: yast2-core < 2.10.6 +# new calls in AutoinstGeneral +Conflicts: autoyast2 < 4.3.23 + Obsoletes: yast2-network-devel-doc <= 3.1.154 Provides: yast2-network-devel-doc = %{version} ++++++ yast2-network-4.3.11.tar.bz2 -> yast2-network-4.3.13.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.11/package/yast2-network.changes new/yast2-network-4.3.13/package/yast2-network.changes --- old/yast2-network-4.3.11/package/yast2-network.changes 2020-07-01 11:51:00.000000000 +0200 +++ new/yast2-network-4.3.13/package/yast2-network.changes 2020-07-17 14:19:09.000000000 +0200 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Thu Jul 16 08:45:00 UTC 2020 - Knut Anderssen <[email protected]> + +- Permit to write networking config changes without touching the + service and other components like the firewall (bsc#1173298) +- Permit dot characters in the hostname allowing to specify it as + a FQDN (bsc#1173298) +- 4.3.13 + +------------------------------------------------------------------- +Wed Jul 15 15:10:34 UTC 2020 - Josef Reidinger <[email protected]> + +- Do not use Profile.current (bsc#1174173) +- 4.3.12 + +------------------------------------------------------------------- Wed Jul 01 08:52:44 UTC 2020 - Knut Anderssen <[email protected]> - Do not remove automatically aliases from /etc/hosts during an diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.11/package/yast2-network.spec new/yast2-network-4.3.13/package/yast2-network.spec --- old/yast2-network-4.3.11/package/yast2-network.spec 2020-07-01 11:51:00.000000000 +0200 +++ new/yast2-network-4.3.13/package/yast2-network.spec 2020-07-17 14:19:09.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.3.11 +Version: 4.3.13 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only @@ -66,6 +66,9 @@ # carrier detection Conflicts: yast2-core < 2.10.6 +# new calls in AutoinstGeneral +Conflicts: autoyast2 < 4.3.23 + Obsoletes: yast2-network-devel-doc <= 3.1.154 Provides: yast2-network-devel-doc = %{version} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.11/src/include/network/services/dns.rb new/yast2-network-4.3.13/src/include/network/services/dns.rb --- old/yast2-network-4.3.11/src/include/network/services/dns.rb 2020-07-01 11:51:00.000000000 +0200 +++ new/yast2-network-4.3.13/src/include/network/services/dns.rb 2020-07-17 14:19:09.000000000 +0200 @@ -63,7 +63,7 @@ "label" => _("Static H&ostname"), "opt" => [], "help" => Ops.get_string(@help, "hostname_global", ""), - "valid_chars" => Hostname.ValidChars, + "valid_chars" => Yast::Hostname.ValidCharsDomain, "validate_type" => :function_no_popup, "validate_function" => fun_ref( method(:ValidateHostname), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.11/src/lib/network/network_autoyast.rb new/yast2-network-4.3.13/src/lib/network/network_autoyast.rb --- old/yast2-network-4.3.11/src/lib/network/network_autoyast.rb 2020-07-01 11:51:00.000000000 +0200 +++ new/yast2-network-4.3.13/src/lib/network/network_autoyast.rb 2020-07-17 14:19:09.000000000 +0200 @@ -144,7 +144,7 @@ def configure_hosts(write: false) log.info("NetworkAutoYast: Hosts configuration") - unless ay_current_profile.key? "host" + if ay_host_section.empty? Host.Write(gui: false) return true @@ -168,6 +168,14 @@ ret end + # setter for networking section. Should be done during import. + # @return [Hash] networking section hash + attr_writer :ay_networking_section + + # setter for host section. Should be done during import. + # @return [Hash] host section hash + attr_writer :ay_host_section + private # Merges two maps with dns related values. @@ -210,31 +218,9 @@ instsys_routing.merge(ay_routing) end - # Returns current AY profile in the internal representation - # - # @return [Hash] hash representing current profile or empty hash - def ay_current_profile - Yast.import "Profile" - - ay_profile = Profile.current - - return {} if ay_profile.nil? || ay_profile.empty? - - ay_profile - end - # Returns networking section of current AY profile def ay_networking_section - return {} if ay_current_profile["networking"].nil? - - ay_current_profile["networking"] - end - - # Returns global section of current AY profile - def ay_general_section - return {} if ay_current_profile["general"].nil? - - ay_current_profile["general"] + @ay_networking_section || {} end # Returns host section of the current AY profile @@ -255,9 +241,7 @@ # # return <Hash> with hosts configuration def ay_host_section - return {} if ay_current_profile["host"].nil? - - ay_current_profile["host"] + @ay_host_section || {} end # Configures given yast submodule according AY configuration diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.11/src/lib/y2network/clients/auto.rb new/yast2-network-4.3.13/src/lib/y2network/clients/auto.rb --- old/yast2-network-4.3.11/src/lib/y2network/clients/auto.rb 2020-07-01 11:51:00.000000000 +0200 +++ new/yast2-network-4.3.13/src/lib/y2network/clients/auto.rb 2020-07-17 14:19:09.000000000 +0200 @@ -77,6 +77,8 @@ end def import(profile) + Yast::NetworkAutoYast.instance.ay_networking_section = profile + modified_profile = Yast::Lan.FromAY(profile) # see bnc#498993 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.11/src/modules/Host.rb new/yast2-network-4.3.13/src/modules/Host.rb --- old/yast2-network-4.3.11/src/modules/Host.rb 2020-07-01 11:51:00.000000000 +0200 +++ new/yast2-network-4.3.13/src/modules/Host.rb 2020-07-17 14:19:09.000000000 +0200 @@ -24,6 +24,7 @@ require "yast2/execute" require "cfa/hosts" require "y2network/autoinst_profile/host_section" +require "network/network_autoyast" module Yast class HostClass < Module @@ -159,6 +160,8 @@ set_names(ip, names) end + NetworkAutoYast.instance.ay_host_section = settings + true end @@ -263,7 +266,7 @@ # # It is expected to be used during installation only. If user configures static # ips during installation and do not assign them particular hostname, then such - # ips are configuret to resolve to the system wide hostname (see Hostname module, + # ips are configured to resolve to the system wide hostname (see Hostname module, # /etc/HOSTNAME) # # Originally implemented as a fix for bnc#664929, later extended for bnc#1039532 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.11/src/modules/Lan.rb new/yast2-network-4.3.13/src/modules/Lan.rb --- old/yast2-network-4.3.11/src/modules/Lan.rb 2020-07-01 11:51:00.000000000 +0200 +++ new/yast2-network-4.3.13/src/modules/Lan.rb 2020-07-17 14:19:09.000000000 +0200 @@ -441,10 +441,8 @@ ProgressNextStage(_("Writing routing configuration...")) orig = Progress.set(false) - target = :sysconfig if Mode.auto - yast_config.write(original: system_config, target: target) - # Force a refresh of the system_config bsc#1162987 - add_config(:system, yast_config.copy) + write_config + Progress.set(orig) Builtins.sleep(sl) @@ -745,6 +743,24 @@ find_config(:yast) end + # Reads system configuration + # + # It resets already read configuration. + def read_config + system_config = Y2Network::Config.from(:sysconfig) + system_config.backend = NetworkService.cached_name + Yast::Lan.add_config(:system, system_config) + Yast::Lan.add_config(:yast, system_config.copy) + end + + # Writes current yast config and replaces the system config with it + def write_config + target = :sysconfig if Mode.auto + yast_config.write(original: system_config, target: target) + # Force a refresh of the system_config bsc#1162987 + add_config(:system, yast_config.copy) + end + publish variable: :ipv6, type: "boolean" publish variable: :AbortFunction, type: "block <boolean>" publish variable: :bond_autoconf_slaves, type: "list <string>" @@ -834,16 +850,6 @@ end end - # Reads system configuration - # - # It clears already read configuration. - def read_config - system_config = Y2Network::Config.from(:sysconfig) - system_config.backend = NetworkService.cached_name - Yast::Lan.add_config(:system, system_config) - Yast::Lan.add_config(:yast, system_config.copy) - end - def select_network_service NetworkService.use(yast_config&.backend&.id) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.11/test/lan_test.rb new/yast2-network-4.3.13/test/lan_test.rb --- old/yast2-network-4.3.11/test/lan_test.rb 2020-07-01 11:51:00.000000000 +0200 +++ new/yast2-network-4.3.13/test/lan_test.rb 2020-07-17 14:19:09.000000000 +0200 @@ -475,4 +475,53 @@ end end end + + describe "#read_config" do + let(:system_config_copy) { double.as_null_object } + + before do + subject.main + allow(Y2Network::Config).to receive(:from).and_return(system_config) + allow(system_config).to receive(:copy).and_return(system_config_copy) + allow(Yast::Lan).to receive(:add_config) + end + + it "reads the Y2Network::Config from sysconfig" do + expect(Y2Network::Config).to receive(:from).and_return(system_config) + subject.read_config + end + + it "adds the read config as the Yast::Lan.system_config" do + expect(Yast::Lan).to receive(:add_config).with(:system, system_config) + subject.read_config + end + + it "copies the system config as the Yast::Lan.yast_config" do + expect(Yast::Lan).to receive(:add_config).with(:yast, system_config_copy) + subject.read_config + end + end + + describe "#write_config" do + let(:yast_config_copy) { double.as_null_object } + + before do + subject.main + allow(Y2Network::Config).to receive(:from).and_return(system_config) + subject.read_config + allow(Yast::Lan.yast_config).to receive(:write) + allow(Yast::Lan.yast_config).to receive(:copy).and_return(yast_config_copy) + end + + it "writes the current yast_config passing the system config as the original" do + expect(Yast::Lan.yast_config).to receive(:write).with(original: system_config, target: nil) + subject.write_config + end + + it "replaces the system config by a copy of the written one" do + expect { subject.write_config } + .to change { Yast::Lan.system_config } + .from(system_config).to(yast_config_copy) + end + end end
