Skip to content

Commit

Permalink
Merge pull request #443 from yast/SLE-15-GA_bnc_1082556
Browse files Browse the repository at this point in the history
Partition configuration: Do not ask for saving values if they have no…
  • Loading branch information
schubi2 committed Jun 5, 2018
2 parents 16791ca + 506d214 commit ca6eb97
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jun 5 10:15:02 CEST 2018 - schubi@suse.de

- Partition configuration: Do not ask for saving values if they have
not been changed at all. (bnc#1082556)
- 4.0.55

-------------------------------------------------------------------
Tue May 29 13:20:54 CEST 2018 - schubi@suse.de

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

Name: autoyast2
Version: 4.0.54
Version: 4.0.55
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
2 changes: 1 addition & 1 deletion src/include/autoinstall/DriveDialog.rb
Expand Up @@ -109,7 +109,7 @@ def updateData(drive)
drive = AutoinstDrive.set(
drive,
"use",
UI.QueryWidget(Id(:cb_reuse), :Value)
symbol2string(UI.QueryWidget(Id(:cb_reuse), :Value))
)
end
deep_copy(drive)
Expand Down
4 changes: 4 additions & 0 deletions src/modules/AutoinstPartPlan.rb
Expand Up @@ -395,6 +395,10 @@ def Import(settings)
log.info("entering Import with #{settings.inspect}")
# index settings
@AutoPartPlan = settings.map.with_index { |d, i| d.merge("_id" => i) }
# set default value
@AutoPartPlan.each do |d|
d["initialize"] = false unless d.has_key?("initialize")
end
true
end

Expand Down
22 changes: 22 additions & 0 deletions test/AutoinstPartPlan_test.rb
Expand Up @@ -64,6 +64,28 @@ def devicegraph_from(file_name)
end
end

describe "#Import" do
let(:sda) { { "device" => "/dev/sda", "initialize" => true } }
let(:sdb) { { "device" => "/dev/sdb" } }
let(:settings) { [sda, sdb] }

before { subject.Import(settings) }

context "\"initialize\" is not given" do
it "set default value for \"initialize\" to false" do
drive = subject.getDrive(1)
expect(drive["initialize"]).to eq(false)
end
end

context "\"initialize\" is given" do
it "does not overwrite \"initialize\" with default setting" do
drive = subject.getDrive(0)
expect(drive["initialize"]).to eq(true)
end
end
end

describe "#Export" do

let(:exported) { subject.Export }
Expand Down

0 comments on commit ca6eb97

Please sign in to comment.