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
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ def convert
#
# @param target [Agama::Storage::ProposalSettings]
def space_actions_conversion(target)
target.space.actions = y2storage_settings.space_settings.actions
target.space.actions = y2storage_settings.space_settings.actions.map do |action|
[action.device, action_to_symbol(action)]
end.to_h
end

# @see #space_action_conversion
def action_to_symbol(action)
return :resize if action.is?(:resize)

action.mandatory ? :force_delete : :delete
end

# Some values of the volumes have to be recovered from Y2Storage proposal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@

let(:y2storage_settings) do
Y2Storage::ProposalSettings.new.tap do |settings|
settings.space_settings.actions = {
"/dev/sda" => :force_delete,
"/dev/sdb1" => :resize
}
settings.space_settings.actions = [
Y2Storage::SpaceActions::Delete.new("/dev/sda", mandatory: true),
Y2Storage::SpaceActions::Resize.new("/dev/sdb1"),
Y2Storage::SpaceActions::Delete.new("/dev/sdb2")
]
end
end

Expand All @@ -45,7 +46,7 @@
settings.encryption.method = Y2Storage::EncryptionMethod::LUKS2
settings.encryption.pbkd_function = Y2Storage::PbkdFunction::ARGON2ID
settings.space.policy = :delete
settings.space.actions = []
settings.space.actions = {}
settings.volumes = [Agama::Storage::Volume.new("/test")]
end
end
Expand All @@ -72,7 +73,8 @@

expect(settings.space.actions).to eq(
"/dev/sda" => :force_delete,
"/dev/sdb1" => :resize
"/dev/sdb1" => :resize,
"/dev/sdb2" => :delete
)
end
end
Expand Down