Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2022-09-06 13:00:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Tue Sep 6 13:00:47 2022 rev:537 rq:1001209 version:4.5.12 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2022-08-30 14:48:46.712013029 +0200 +++ /work/SRC/openSUSE:Factory/.yast2.new.2083/yast2.changes 2022-09-06 13:00:58.858959083 +0200 @@ -1,0 +2,8 @@ +Thu Sep 1 08:08:30 UTC 2022 - Knut Anderssen <kanders...@suse.com> + +- Added a parameter to NetworkService.EnableDisableNow method in + order to ensure that the selected network service is enabled even + when the selection has not been modified (bsc#1202479) +- 4.5.12 + +------------------------------------------------------------------- Old: ---- yast2-4.5.11.tar.bz2 New: ---- yast2-4.5.12.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.z7yeku/_old 2022-09-06 13:00:59.482960659 +0200 +++ /var/tmp/diff_new_pack.z7yeku/_new 2022-09-06 13:00:59.486960669 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.5.11 +Version: 4.5.12 Release: 0 Summary: YaST2 Main Package ++++++ yast2-4.5.11.tar.bz2 -> yast2-4.5.12.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.5.11/library/network/src/modules/NetworkService.rb new/yast2-4.5.12/library/network/src/modules/NetworkService.rb --- old/yast2-4.5.11/library/network/src/modules/NetworkService.rb 2022-08-29 14:03:07.000000000 +0200 +++ new/yast2-4.5.12/library/network/src/modules/NetworkService.rb 2022-09-05 09:31:48.000000000 +0200 @@ -237,11 +237,18 @@ @cached_name = nil end - # Helper to apply a change of the network service - def EnableDisableNow - return if !Modified() + # Helper to apply a change of the network service enabling the service selected and taking care + # of disabling the current one in case of modified. + # + # TODO: this method could take care of disabling all the services except the one selected in + # order to prevent that multiple backends are enabled at the same time. + # + # @param force [Boolean] whether the service should forced to be enabled or not; it will not + # disable other services apart of the one currently in use in case of modified + def EnableDisableNow(force: false) + return unless force || Modified() - if current_name + if current_name && Modified() stop_service(current_name) disable_service(current_name) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.5.11/library/network/test/network_service_test.rb new/yast2-4.5.12/library/network/test/network_service_test.rb --- old/yast2-4.5.11/library/network/test/network_service_test.rb 2022-08-29 14:03:07.000000000 +0200 +++ new/yast2-4.5.12/library/network/test/network_service_test.rb 2022-09-05 09:31:48.000000000 +0200 @@ -47,42 +47,50 @@ describe "#EnableDisableNow" do subject { Yast::NetworkService } + let(:current_name) { :wicked } + let(:cached_name) { :wicked } before(:each) do - expect(subject).to receive(:Modified).and_return(true) + allow(subject).to receive(:Modified).and_return(current_name != cached_name) + allow(subject).to receive(:cached_name).and_return(cached_name) + allow(subject).to receive(:current_name).and_return(current_name) + end + + context "when the service has not changed but it is forced to be enabled" do + it "enables the selected service" do + expect(subject).to receive(:RunSystemCtl).with("wicked", "enable", any_args) + + subject.EnableDisableNow(force: true) + end end context "When changing running service" do - before(:each) do - allow(subject).to receive(:current_name).and_return(:netconfig) + let(:current_name) { :netconfig } + before(:each) do # using anything instead of exact service name because of some magic in identifying the service in the system expect(subject).to receive(:RunSystemCtl).with(anything, /stop|kill/) expect(subject).to receive(:RunSystemCtl).with("network", "disable") end it "disables old service and enables new one" do - allow(subject).to receive(:cached_name).and_return(:wicked) - expect(subject).to receive(:RunSystemCtl).with("wicked", "enable", any_args) subject.EnableDisableNow end - it "only disables old service when no network service was requested" do - allow(subject).to receive(:cached_name).and_return(nil) - - expect(subject).not_to receive(:RunSystemCtl).with("wicked", "enable", any_args) + context "when no service is selected to be run" do + let(:cached_name) { nil } - subject.EnableDisableNow + it "only disables old service when no network service was requested" do + expect(subject).not_to receive(:RunSystemCtl).with(anything, "enable", any_args) + subject.EnableDisableNow + end end end context "When activating a service if none is running" do - before(:each) do - allow(subject).to receive(:current_name).and_return(nil) - allow(subject).to receive(:cached_name).and_return(:wicked) - end + let(:current_name) { nil } it "activates new service" do expect(subject).to receive(:RunSystemCtl).with("wicked", "enable", any_args) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.5.11/package/yast2.changes new/yast2-4.5.12/package/yast2.changes --- old/yast2-4.5.11/package/yast2.changes 2022-08-29 14:03:07.000000000 +0200 +++ new/yast2-4.5.12/package/yast2.changes 2022-09-05 09:31:48.000000000 +0200 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Thu Sep 1 08:08:30 UTC 2022 - Knut Anderssen <kanders...@suse.com> + +- Added a parameter to NetworkService.EnableDisableNow method in + order to ensure that the selected network service is enabled even + when the selection has not been modified (bsc#1202479) +- 4.5.12 + +------------------------------------------------------------------- Fri Aug 26 13:18:39 UTC 2022 - Josef Reidinger <jreidin...@suse.com> - On transactional systems, inform the user that packages are diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.5.11/package/yast2.spec new/yast2-4.5.12/package/yast2.spec --- old/yast2-4.5.11/package/yast2.spec 2022-08-29 14:03:07.000000000 +0200 +++ new/yast2-4.5.12/package/yast2.spec 2022-09-05 09:31:48.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.5.11 +Version: 4.5.12 Release: 0 Summary: YaST2 Main Package