Skip to content

Commit

Permalink
Merge branch 'SLE-15-SP3' into merge-SP3
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Apr 4, 2022
2 parents 81f27da + 4ea8176 commit 505b73f
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 72 deletions.
7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Apr 1 06:12:50 UTC 2022 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Respect general/signature-handling settings during the 2nd
stage (bsc#1197655).
- 4.4.36

-------------------------------------------------------------------
Mon Mar 7 11:00:12 UTC 2022 - 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.35
Version: 4.4.36
Release: 0
Summary: YaST2 - Automated Installation
License: GPL-2.0-only
Expand Down
8 changes: 3 additions & 5 deletions src/clients/inst_autopost.rb
Expand Up @@ -18,7 +18,6 @@ def main
textdomain "autoinst"
Yast.import "Profile"
Yast.import "AutoInstall"
Yast.import "AutoinstGeneral"
Yast.import "Call"
Yast.import "AutoinstSoftware"
Yast.import "AutoinstScripts"
Expand Down Expand Up @@ -73,13 +72,12 @@ def main
Y2Autoinstall::Ask::Runner.new(
Yast::Profile.current, stage: Y2Autoinstall::Ask::Stage::CONT
).run
# FIXME: too late here, even though it would be the better place
# if (Profile::current["general"]:$[] != $[])
# AutoinstGeneral::Import(Profile::current["general"]:$[]);
# AutoinstGeneral::SetSignatureHandling();

Builtins.y2milestone("Steps: %1", steps)

general_settings = Profile.current.fetch("general", {})
AutoinstGeneral.Import(general_settings) unless general_settings.empty?

importer = Y2Autoinstallation::Importer.new(Profile.current)
modules_to_write.each do |description|
Builtins.y2milestone("current resource: %1", description.resource_name)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/AutoInstall.rb
Expand Up @@ -22,10 +22,10 @@ def main
Yast.import "Profile"
Yast.import "Mode"
Yast.import "Stage"
Yast.import "AddOnProduct"
Yast.import "AutoInstallRules"
Yast.import "AutoinstConfig"
Yast.import "AutoinstGeneral"
Yast.import "AddOnProduct"
Yast.import "Report"
Yast.import "TFTP"

Expand Down
12 changes: 0 additions & 12 deletions src/modules/AutoinstGeneral.rb
Expand Up @@ -60,7 +60,6 @@ def main

# default value of settings modified
@modified = false
AutoinstGeneral()
end

# Function sets internal variable, which indicates, that any
Expand Down Expand Up @@ -457,17 +456,6 @@ def Write
nil
end

# Constructor
def AutoinstGeneral
return unless Stage.cont

# FIXME: wrong place for this
general_settings = Profile.current.fetch("general", {})
Import(general_settings) unless general_settings.empty?

nil
end

# Set the "kexec_reboot" flag in the product
# description in order to force a reboot with
# kexec at the end of the first installation
Expand Down
53 changes: 0 additions & 53 deletions test/AutoinstGeneral_test.rb
Expand Up @@ -23,59 +23,6 @@
allow(Yast).to receive(:import).with("FileSystems").and_return(nil)
end

describe "#main" do
let(:second_stage) { false }
let(:imported_profile) { { "general" => general_settings } }
let(:general_settings) { { "mode" => true } }

before do
allow(Yast::Stage).to receive(:cont).and_return(second_stage)
end

context "on first stage" do
let(:second_stage) { false }

it "does not try to import the profile" do
expect(subject).to_not receive(:Import)
subject.main
end

it "does not set the signatures handling callbacks" do
expect(subject).to_not receive(:SetSignatureHandling)
subject.main
end
end

context "on second stage" do
let(:second_stage) { true }

before do
allow(Yast::Profile).to receive(:current).and_return(imported_profile)
end

context "and the profile contains a 'general' section" do
it "imports the profile" do
expect(subject).to receive(:Import).with(general_settings)
subject.main
end
end

context "and the profile does not contain a 'general' section" do
let(:general_settings) { {} }

it "does not try to import the profile" do
expect(subject).to_not receive(:Import)
subject.main
end
end

it "sets the signatures handling callbacks" do
expect(subject).to receive(:SetSignatureHandling)
subject.main
end
end
end

describe "#Write" do
before do
allow(Yast::AutoinstStorage).to receive(:Write)
Expand Down

0 comments on commit 505b73f

Please sign in to comment.