Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion service/lib/agama/autoyast/profile_checker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def elements_from(profile, parent = "")
return [] unless profile.is_a?(Hash)

profile.map do |k, v|
next if empty?(v)

current = parent.empty? ? k : "#{parent}#{ProfileDescription::SEPARATOR}#{k}"

children = if v.is_a?(Array)
Expand All @@ -62,7 +64,12 @@ def elements_from(profile, parent = "")
end

[current, *children]
end.flatten
end.flatten.compact
end

# Determine whether the given value is empty.
def empty?(value)
value.nil? || (value.respond_to?(:empty?) && value.empty?)
end
end
end
Expand Down
6 changes: 6 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Mar 10 14:10:18 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Do not report AutoYaST elements as unsupported if the value is empty
(bsc#1259458).

-------------------------------------------------------------------
Tue Feb 24 16:59:38 UTC 2026 - Ladislav Slezák <lslezak@suse.com>

Expand Down
12 changes: 11 additions & 1 deletion service/test/agama/autoyast/profile_checker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,21 @@
end
end

context "when an unsupported section is included" do
context "when an unsupported section with empty value is included" do
let(:profile) do
{ "auth-client" => {} }
end

it "ignores the unsupported element" do
expect(subject.find_unsupported(profile)).to eq([])
end
end

context "when an unsupported section is included" do
let(:profile) do
{ "auth-client" => { "some" => "value" } }
end

it "returns an array with the unsupported element" do
expect(subject.find_unsupported(profile)).to contain_exactly(
an_object_having_attributes(key: "auth-client")
Expand Down
Loading