diff --git a/package/autoyast2.changes b/package/autoyast2.changes index da891aa2c..a28cc0ce1 100644 --- a/package/autoyast2.changes +++ b/package/autoyast2.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 20 10:50:34 UTC 2025 - Imobach Gonzalez Sosa + +- Allow skipping profile fetch errors by setting + YAST_SKIP_PROFILE_FETCH_ERROR=1 (see gh#agama-project/agama#2180). +- 5.0.5 + ------------------------------------------------------------------- Thu Feb 20 14:29:46 UTC 2025 - Knut Anderssen diff --git a/package/autoyast2.spec b/package/autoyast2.spec index b39da8178..43ef8e9a7 100644 --- a/package/autoyast2.spec +++ b/package/autoyast2.spec @@ -22,7 +22,7 @@ %endif Name: autoyast2 -Version: 5.0.4 +Version: 5.0.5 Release: 0 Summary: YaST2 - Automated Installation License: GPL-2.0-only diff --git a/src/modules/ProfileLocation.rb b/src/modules/ProfileLocation.rb index ddfbc68a0..c612c34ca 100644 --- a/src/modules/ProfileLocation.rb +++ b/src/modules/ProfileLocation.rb @@ -123,7 +123,7 @@ def Process if !ret # autoyast hit an error while fetching it's config file error = _("An error occurred while fetching the profile:\n") - Report.Error(Ops.add(error, @GET_error)) + Report.Error(Ops.add(error, @GET_error)) if ENV["YAST_SKIP_PROFILE_FETCH_ERROR"] != "1" return false end tmp = SCR.Read(path(".target.string"), localfile) diff --git a/test/ProfileLocation_test.rb b/test/ProfileLocation_test.rb index 31ee4f02a..657f8ac70 100755 --- a/test/ProfileLocation_test.rb +++ b/test/ProfileLocation_test.rb @@ -71,6 +71,30 @@ end end + context "when the profile does not exist" do + before do + allow(subject).to receive(:Get).and_return(false) + end + + it "reports an error" do + expect(Yast::Report).to receive(:Error) + expect(subject.Process).to eq(false) + end + + context "and fetch errors are disabled" do + around do |example| + ENV["YAST_SKIP_PROFILE_FETCH_ERROR"] = "1" + example.run + ENV.delete("YAST_SKIP_PROFILE_FETCH_ERROR") + end + + it "does not report an error" do + expect(Yast::Report).to_not receive(:Error) + expect(subject.Process).to eq(false) + end + end + end + context "when the profile is an erb file" do let(:filepath) { "autoinst.erb" }