Hello community,

here is the log from the commit of package yast2-tune for openSUSE:Factory 
checked in at 2019-12-14 12:02:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-tune (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-tune.new.4691 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-tune"

Sat Dec 14 12:02:25 2019 rev:66 rq:751258 version:4.2.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-tune/yast2-tune.changes    2019-10-16 
09:09:38.304340783 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-tune.new.4691/yast2-tune.changes  
2019-12-14 12:02:37.847410341 +0100
@@ -1,0 +2,7 @@
+Tue Nov 26 16:38:08 UTC 2019 - David Diaz <[email protected]>
+
+- Abort the execution when the bootloader cannot be read
+  (related to bsc#1137688).
+- 4.2.2
+
+-------------------------------------------------------------------

Old:
----
  yast2-tune-4.2.1.tar.bz2

New:
----
  yast2-tune-4.2.2.tar.bz2

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

Other differences:
------------------
++++++ yast2-tune.spec ++++++
--- /var/tmp/diff_new_pack.uYxhgs/_old  2019-12-14 12:02:39.503410094 +0100
+++ /var/tmp/diff_new_pack.uYxhgs/_new  2019-12-14 12:02:39.511410092 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-tune
-Version:        4.2.1
+Version:        4.2.2
 Release:        0
 Summary:        YaST2 - Hardware Tuning
 License:        GPL-2.0-or-later

++++++ yast2-tune-4.2.1.tar.bz2 -> yast2-tune-4.2.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-tune-4.2.1/package/yast2-tune.changes 
new/yast2-tune-4.2.2/package/yast2-tune.changes
--- old/yast2-tune-4.2.1/package/yast2-tune.changes     2019-10-07 
16:50:37.000000000 +0200
+++ new/yast2-tune-4.2.2/package/yast2-tune.changes     2019-11-27 
11:21:45.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Tue Nov 26 16:38:08 UTC 2019 - David Diaz <[email protected]>
+
+- Abort the execution when the bootloader cannot be read
+  (related to bsc#1137688).
+- 4.2.2
+
+-------------------------------------------------------------------
 Fri Oct  4 13:30:49 UTC 2019 - Imobach Gonzalez Sosa <[email protected]>
 
 - Place sysctl settings in /etc/sysctl.d/ (jsc#SLE-9077).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-tune-4.2.1/package/yast2-tune.spec 
new/yast2-tune-4.2.2/package/yast2-tune.spec
--- old/yast2-tune-4.2.1/package/yast2-tune.spec        2019-10-07 
16:50:37.000000000 +0200
+++ new/yast2-tune-4.2.2/package/yast2-tune.spec        2019-11-27 
11:21:45.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-tune
-Version:        4.2.1
+Version:        4.2.2
 Release:        0
 Summary:        YaST2 - Hardware Tuning
 License:        GPL-2.0-or-later
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-tune-4.2.1/src/include/hwinfo/system_settings_ui.rb 
new/yast2-tune-4.2.2/src/include/hwinfo/system_settings_ui.rb
--- old/yast2-tune-4.2.1/src/include/hwinfo/system_settings_ui.rb       
2019-10-07 16:50:37.000000000 +0200
+++ new/yast2-tune-4.2.2/src/include/hwinfo/system_settings_ui.rb       
2019-11-27 11:21:45.000000000 +0100
@@ -58,7 +58,11 @@
       # to avoid of the very long starting time of the yast module
       # because the Storage module (which is imported by the Bootloader 
(imported by the SystemSettings module))
       # has a Read() function call in its constructor.
-      SystemSettings.Read
+
+      # Aborting without any message since SystemSettings.Read
+      # already reported the problem to the user
+      return :abort unless SystemSettings.Read
+
       Progress.set(progress_orig)
 
       Progress.NextStage
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-tune-4.2.1/src/modules/SystemSettings.rb 
new/yast2-tune-4.2.2/src/modules/SystemSettings.rb
--- old/yast2-tune-4.2.1/src/modules/SystemSettings.rb  2019-10-07 
16:50:37.000000000 +0200
+++ new/yast2-tune-4.2.2/src/modules/SystemSettings.rb  2019-11-27 
11:21:45.000000000 +0100
@@ -56,7 +56,9 @@
     # @see #read_scheduler
     def Read
       read_sysrq
-      read_scheduler
+      ret = read_scheduler
+
+      return false unless ret
       @modified = false
       true
     end
@@ -285,13 +287,22 @@
     # Read IO scheduler configuration updating the module's value
     #
     # @see Read
+    #
+    # @return [Boolean] false if there is a problem reading the bootloader; 
true otherwise
     def read_scheduler
-      # Read bootloader settings in normal mode
-      Bootloader.Read if Mode.normal
+      # Try to read the bootloader settings in normal mode.
+      # If there is a problem, the user will be warned directly by the 
bootloader module.
+      if Mode.normal
+        bootloader_read = Bootloader.Read
+
+        return false unless bootloader_read
+      end
 
       # Set IO scheduler
       SetIOScheduler(current_elevator)
       log.info("Global IO scheduler: #{GetIOScheduler()}")
+
+      true
     end
 
     # Read SysRq keys configuration updating the module's value
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-tune-4.2.1/test/system_settings_test.rb 
new/yast2-tune-4.2.2/test/system_settings_test.rb
--- old/yast2-tune-4.2.1/test/system_settings_test.rb   2019-10-07 
16:50:37.000000000 +0200
+++ new/yast2-tune-4.2.2/test/system_settings_test.rb   2019-11-27 
11:21:45.000000000 +0100
@@ -32,6 +32,7 @@
   describe "#Read" do
     let(:kernel_sysrq)  { "1" }
     let(:sysctl_sysrq)  { "1" }
+    let(:mode) { "normal" }
 
     before do
       allow(sysctl_file).to receive(:kernel_sysrq).and_return(sysctl_sysrq)
@@ -39,6 +40,7 @@
         .and_return(kernel_sysrq)
       allow(Yast::Bootloader).to receive(:kernel_param)
         .with(:common, "elevator").and_return(scheduler)
+      allow(Yast::Mode).to receive(:mode).and_return(mode)
     end
 
     context "when SysRq keys are enabled via sysctl" do
@@ -69,55 +71,78 @@
       end
     end
 
-    context "when scheduler parameter is missing" do
-      let(:scheduler) { :missing }
-
-      it "unsets IO scheduler" do
-        settings.Read
-        expect(settings.GetIOScheduler).to eq("")
-      end
-    end
-
-    context "when scheduler parameter is present but does not have a value" do
-      let(:scheduler) { :present }
-
-      it "unsets IO scheduler" do
-        settings.Read
-        expect(settings.GetIOScheduler).to eq("")
-      end
-    end
-
-    context "when scheduler parameter has a valid value" do
-      it "sets IO scheduler to that value" do
-        settings.Read
-        expect(settings.GetIOScheduler).to eq(scheduler)
+    context "when is in normal mode" do
+      before do
+        allow(Yast::Bootloader).to receive(:Read).and_return(bootloader_read)
       end
-    end
 
-    context "when scheduler parameter has an invalid value" do
-      let(:scheduler) { "some-scheduler" }
+      context "and the bootloader can be read" do
+        let(:bootloader_read) { true }
 
-      it "unsets IO scheduler" do
-        settings.Read
-        expect(settings.GetIOScheduler).to eq("")
+        it "returns true" do
+          expect(settings.Read).to eq(true)
+        end
+
+        context "when scheduler parameter is missing" do
+          let(:scheduler) { :missing }
+
+          it "unsets IO scheduler" do
+            settings.Read
+            expect(settings.GetIOScheduler).to eq("")
+          end
+        end
+
+        context "when scheduler parameter is present but does not have a 
value" do
+          let(:scheduler) { :present }
+
+          it "unsets IO scheduler" do
+            settings.Read
+            expect(settings.GetIOScheduler).to eq("")
+          end
+        end
+
+        context "when scheduler parameter has a valid value" do
+          it "sets IO scheduler to that value" do
+            settings.Read
+            expect(settings.GetIOScheduler).to eq(scheduler)
+          end
+        end
+
+        context "when scheduler parameter has an invalid value" do
+          let(:scheduler) { "some-scheduler" }
+
+          it "unsets IO scheduler" do
+            settings.Read
+            expect(settings.GetIOScheduler).to eq("")
+          end
+        end
+
+        it "reads bootloader configuration" do
+          expect(Yast::Bootloader).to receive(:Read)
+          settings.Read
+        end
+      end
+
+      context "but the bootloader cannot be read" do
+        let(:bootloader_read) { false }
+
+        it "returns false" do
+          expect(settings.Read).to eq(false)
+        end
+
+        it "does not set the scheduler" do
+          expect(subject).to_not receive(:SetIOScheduler)
+        end
       end
     end
 
-    it "reads bootloader configuration" do
-      expect(Yast::Bootloader).to receive(:Read)
-      settings.Read
-    end
-
     context "is not in normal mode" do
-      before do
-        allow(Yast::Mode).to receive(:mode).and_return("installation")
-      end
+      let(:mode) { "installation" }
 
       it "does not read bootloader configuration" do
         expect(Yast::Bootloader).to_not receive(:Read)
         settings.Read
       end
-
     end
   end
 


Reply via email to