Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Feb 27, 2018
1 parent 39afaed commit 7fc03a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/lib/y2partitioner/actions/controllers/lvm_vg.rb
Expand Up @@ -189,6 +189,7 @@ def add_device(device)
# in case the device is removed from the volume group during this
# execution of the partitioner.
device.adapted_id = Y2Storage::PartitionId::LVM if device.is?(:partition)
device = device.encryption if device.encryption
device.remove_descendants
vg.add_lvm_pv(device)
end
Expand All @@ -205,6 +206,7 @@ def remove_device(device)
end

# TODO: restore status and descendants of the device when it makes sense
device = device.encryption if device.encryption
vg.remove_lvm_pv(device)
end

Expand Down
4 changes: 2 additions & 2 deletions test/y2partitioner/actions/controllers/lvm_vg_test.rb
Expand Up @@ -516,10 +516,10 @@ def dev(name)
expect(sda2.filesystem).to be_nil
end

it "removes the previous encryption from the device" do
it "keeps the previous encryption from the device" do
expect(sda4.encrypted?).to eq(true)
controller.add_device(sda4)
expect(sda4.encrypted?).to eq(false)
expect(sda4.encrypted?).to eq(true)
end

it "sets the partition identifier to LVM" do
Expand Down

0 comments on commit 7fc03a6

Please sign in to comment.