Skip to content

Commit

Permalink
Merge pull request #772 from yast/bsc-1187898
Browse files Browse the repository at this point in the history
Do not crash while importing the <scripts> section
  • Loading branch information
imobachgs committed Jul 1, 2021
2 parents c22e5d4 + 5fcd64a commit 611358c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jul 1 07:02:20 UTC 2021 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Do not crash importing the <scripts> section (boo#1187898).
This bug does not affect the installation process.
- 4.4.11

-------------------------------------------------------------------
Mon Jun 14 09:37:41 UTC 2021 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -22,7 +22,7 @@
%endif

Name: autoyast2
Version: 4.4.10
Version: 4.4.11
Release: 0
Summary: YaST2 - Automated Installation
License: GPL-2.0-only
Expand Down
5 changes: 3 additions & 2 deletions src/lib/autoinstall/clients/scripts_auto.rb
Expand Up @@ -20,6 +20,7 @@
require "installation/auto_client"

Yast.import "AutoinstScripts"
Yast.import "Profile"

module Y2Autoinstallation
module Clients
Expand All @@ -33,15 +34,15 @@ def initialize
end

def import(map)
Yast::AutoinstScripts.Import(map)
Yast::AutoinstScripts.Import(Yast::ProfileHash.new(map))
end

def summary
Yast::AutoinstScripts.Summary
end

def reset
Yast::AutoinstScripts.Import({})
Yast::AutoinstScripts.Import(Yast::ProfileHash.new)
end

def modified?
Expand Down
7 changes: 5 additions & 2 deletions test/lib/clients/scripts_auto_test.rb
Expand Up @@ -24,7 +24,7 @@
let(:mod) { Yast::AutoinstScripts }
describe "#import" do
it "imports its param" do
expect(mod).to receive(:Import).with({})
expect(mod).to receive(:Import).with(Yast::ProfileHash)

subject.import({})
end
Expand All @@ -40,7 +40,10 @@

describe "#reset" do
it "repropose module" do
expect(mod).to receive(:Import).with({})
expect(mod).to receive(:Import) do |arg|
expect(arg).to be_a(Yast::ProfileHash)
expect(arg).to be_empty
end

subject.reset
end
Expand Down

0 comments on commit 611358c

Please sign in to comment.