Skip to content

Commit

Permalink
Fix ProposalSettings conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
ancorgs committed Sep 22, 2024
1 parent 4d0d973 commit 07b3a48
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
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,10 @@

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")
]
end
end

Expand All @@ -45,7 +45,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 Down

0 comments on commit 07b3a48

Please sign in to comment.