summaryrefslogtreecommitdiff
path: root/src/cmd/cloud_init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/cloud_init.rs')
-rw-r--r--src/cmd/cloud_init.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/cmd/cloud_init.rs b/src/cmd/cloud_init.rs
index a9b3588..b266eb4 100644
--- a/src/cmd/cloud_init.rs
+++ b/src/cmd/cloud_init.rs
@@ -1,17 +1,27 @@
+//! The `cloud-init` sub-command.
+
use crate::cloudinit::{CloudInitConfig, CloudInitError};
use crate::spec::Specification;
use log::{debug, info};
use std::path::Path;
+/// Errors from this module.
#[derive(Debug, thiserror::Error)]
pub enum CloudInitCommandError {
+ /// Error in the cloud-init configuration.
#[error(transparent)]
CloudInitError(#[from] CloudInitError),
+ /// Error doing I/O.
#[error(transparent)]
IoError(#[from] std::io::Error),
}
+/// The `cloud-init` sub-command.
+///
+/// This sub-command generates the cloud-init configuration based on
+/// specifications provided by the caller and writes them to files in
+/// a directory named by the caller.
pub fn cloud_init(specs: &[Specification], dirname: &Path) -> Result<(), CloudInitCommandError> {
for spec in specs {
let dirname = dirname.join(&spec.name);