Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
joseivanlopez committed Oct 23, 2024
1 parent 9ce2940 commit 2b421e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion service/lib/agama/dbus/storage/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def apply_config(serialized_config)

# Gets and serializes the storage config used to calculate the current proposal.
#
# @param solved [Boolean] Whether to recover solved config.
# @param solved [Boolean] Whether to recover the solved config.
# @return [String] Serialized config according to the JSON schema.
def recover_config(solved: false)
json = proposal.storage_json(solved: solved)
Expand Down
14 changes: 9 additions & 5 deletions service/lib/agama/storage/proposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def available_devices

# Storage JSON config from the current proposal, if any.
#
# @param solved [Boolean] Whether to get solved config.
# @return [Hash] JSON according to schema.
# @param solved [Boolean] Whether to get the solved config.
# @return [Hash] JSON config according to the JSON schema.
def storage_json(solved: false)
return source_json if !solved && source_json

Expand Down Expand Up @@ -221,10 +221,14 @@ def guided_settings
# @return [ProposalStrategies::Base]
attr_reader :strategy

# @return [Hash, nil] Source JSON without processing.
# Source JSON config without processing.
#
# @return [Hash, nil] nil if no proposal has been calculated from JSON.
attr_reader :source_json

# @return [Storage::Config, nil] Source storage config without solving.
# Source storage config without solving.
#
# @return [Storage::Config, nil] nil if no agama proposal has been calculated.
attr_reader :source_config

# Resets values.
Expand All @@ -237,7 +241,7 @@ def reset
# Storage config used for calculating the proposal (only for Agama strategy).
#
# @param solved [Boolean] Whether to get solved config.
# @return [Storage::Config, nil]
# @return [Storage::Config, nil] nil if no agama proposal has been calculated.
def config(solved: false)
return unless strategy.is_a?(ProposalStrategies::Agama)

Expand Down

0 comments on commit 2b421e4

Please sign in to comment.