Skip to content

Commit

Permalink
Do not fail when the storage proposal is missing (#1220)
Browse files Browse the repository at this point in the history
* The CLI does not fails when there is not storage proposal.
* Properly detect when LVM is activated (from the CLI).
  • Loading branch information
imobachgs authored May 16, 2024
2 parents 5e6c665 + 0288060 commit 45d0b8a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rust/agama-lib/src/storage/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl<'a> StorageClient<'a> {
/// DEPRECATED, use proposal_settings instead
pub async fn lvm(&self) -> Result<Option<bool>, ServiceError> {
let settings = self.proposal_settings().await?;
Ok(Some(matches!(settings.target, ProposalTarget::Disk)))
Ok(Some(!matches!(settings.target, ProposalTarget::Disk)))
}

/// Returns the encryption password proposal setting
Expand Down
6 changes: 5 additions & 1 deletion rust/agama-lib/src/storage/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ impl<'a> StorageStore<'a> {
}

pub async fn load(&self) -> Result<StorageSettings, ServiceError> {
let boot_device = self.storage_client.boot_device().await?;
// If it is not possible to get the settings (e.g., there are no settings yet), return
// the default.
let Ok(boot_device) = self.storage_client.boot_device().await else {
return Ok(StorageSettings::default());
};
let lvm = self.storage_client.lvm().await?;
let encryption_password = self.storage_client.encryption_password().await?;

Expand Down
7 changes: 7 additions & 0 deletions rust/package/agama.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu May 16 10:31:38 UTC 2024 - Imobach Gonzalez Sosa <[email protected]>

- The CLI does not fail when the storage proposal is missing
(gh#openSUSE/agama#1220).
- Properly detect whether LVM is activated.

-------------------------------------------------------------------
Thu May 16 06:19:36 UTC 2024 - Imobach Gonzalez Sosa <[email protected]>

Expand Down

0 comments on commit 45d0b8a

Please sign in to comment.