Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce profile #116

Merged
merged 3 commits into from
Jun 10, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions package/yast2-kdump.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jun 9 19:43:21 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

- Reduce autoyast profile size if kdump is disabled (bsc#1172749)
- 4.3.1

-------------------------------------------------------------------
Tue May 12 09:10:14 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-kdump.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-kdump
Version: 4.3.0
Version: 4.3.1
Release: 0
Summary: Configuration of kdump
License: GPL-2.0-only
Expand Down
24 changes: 14 additions & 10 deletions src/modules/Kdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -930,16 +930,20 @@ def filterExport(settings)
# Export kdump settings to a map
# @return kdump settings
def Export
crash_kernel = crash_kernel_values
crash_kernel = crash_kernel[0] if crash_kernel.size == 1
crash_xen_kernel = crash_xen_kernel_values
crash_xen_kernel = crash_xen_kernel[0] if crash_xen_kernel.size == 1
out = {
"crash_kernel" => crash_kernel,
"crash_xen_kernel" => crash_xen_kernel,
"add_crash_kernel" => @add_crashkernel_param,
"general" => filterExport(@KDUMP_SETTINGS)
}
if @add_crashkernel_param
crash_kernel = crash_kernel_values
crash_kernel = crash_kernel[0] if crash_kernel.size == 1
crash_xen_kernel = crash_xen_kernel_values
crash_xen_kernel = crash_xen_kernel[0] if crash_xen_kernel.size == 1
out = {
"crash_kernel" => crash_kernel,
"crash_xen_kernel" => crash_xen_kernel,
"add_crash_kernel" => true,
"general" => filterExport(@KDUMP_SETTINGS)
}
else
out = { "add_crash_kernel" => false }
end

Builtins.y2milestone("Kdump exporting settings: %1", out)
deep_copy(out)
Expand Down
10 changes: 10 additions & 0 deletions test/kdump_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
Yast::Kdump.reset
end

subject { Yast::Kdump }

# allocated_memory is a hash, values are strings in megabytes
# total_memory is an integer in megabytes
describe "#ProposeAllocatedMemory" do
Expand Down Expand Up @@ -847,4 +849,12 @@
expect { Yast::Kdump.Import(nil) }.to_not raise_error
end
end

describe ".Export" do
it "exports only add_crash_kernel=false if kdump is disabled" do
subject.add_crashkernel_param = false

expect(subject.Export).to eq("add_crash_kernel" => false)
end
end
end