Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not fail when the storage proposal is missing #1220

Merged
merged 3 commits into from
May 16, 2024
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
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