Skip to content

Commit

Permalink
Merge e67e562 into 8630995
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Dec 30, 2019
2 parents 8630995 + e67e562 commit 8d8dfe3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
7 changes: 7 additions & 0 deletions package/yast2-bootloader.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Dec 30 14:51:02 UTC 2019 - Josef Reidinger <jreidinger@suse.com>

- Report proper error when /etc/default/grub missing and allow
user to repropose it (bsc#1100755)
- 4.2.14

-------------------------------------------------------------------
Tue Nov 26 12:22:50 UTC 2019 - David Diaz <dgonzalez@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-bootloader.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-bootloader
Version: 4.2.13
Version: 4.2.14
Release: 0
Summary: YaST2 - Bootloader Configuration
License: GPL-2.0-or-later
Expand Down
7 changes: 6 additions & 1 deletion src/lib/bootloader/grub2base.rb
Expand Up @@ -98,7 +98,12 @@ def cpu_mitigations=(value)
def read
super

grub_default.load
begin
grub_default.load
rescue Errno::ENOENT
raise BrokenConfiguration, _("File /etc/default/grub missing on system")
end

grub_cfg = CFA::Grub2::GrubCfg.new
begin
grub_cfg.load
Expand Down
8 changes: 8 additions & 0 deletions test/grub2base_test.rb
Expand Up @@ -58,6 +58,14 @@

expect(subject.trusted_boot).to eq false
end

it "raises BrokenConfiguration if /etc/default/grub missing" do
default = double
allow(default).to receive(:load).and_raise(Errno::ENOENT)
allow(::CFA::Grub2::Default).to receive(:new).and_return(default)

expect { subject.read }.to raise_error(::Bootloader::BrokenConfiguration)
end
end

describe "write" do
Expand Down

0 comments on commit 8d8dfe3

Please sign in to comment.