-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: Process 'legacy_autoyast_storage' section
- Loading branch information
1 parent
1d84aee
commit 11288fe
Showing
9 changed files
with
74 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//! Implements support for handling the storage AutoYaST settings | ||
pub mod store; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//! Implements the store for the storage AutoYaST settings. | ||
|
||
use crate::error::ServiceError; | ||
use crate::storage::StorageClient; | ||
use zbus::Connection; | ||
|
||
/// Stores the storage AutoYaST settings to the D-Bus service. | ||
/// | ||
/// NOTE: The AutoYaST settings are not loaded from D-Bus because they cannot be modified. The only | ||
/// way of using the storage AutoYaST settings is by loading a json config file. | ||
pub struct StorageAutoyastStore<'a> { | ||
storage_client: StorageClient<'a>, | ||
} | ||
|
||
impl<'a> StorageAutoyastStore<'a> { | ||
pub async fn new(connection: Connection) -> Result<StorageAutoyastStore<'a>, ServiceError> { | ||
Ok(Self { | ||
storage_client: StorageClient::new(connection).await?, | ||
}) | ||
} | ||
|
||
pub async fn store(&self, settings: &str) -> Result<(), ServiceError> { | ||
self.storage_client.calculate_autoyast(settings).await?; | ||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters