diff --git a/Cargo.toml b/Cargo.toml index dc2781f4..0e030abb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ publish = false # cargo dist --> Avoid publishing to crates.io # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -mesa = "0.18.1" +mesa = "0.18.2" # mesa = { path = "../mesa" } # Only for development purposes chrono = "0.4.31" anyhow = "1.0.44" diff --git a/src/cli/build.rs b/src/cli/build.rs index 2a94a79b..71009a62 100644 --- a/src/cli/build.rs +++ b/src/cli/build.rs @@ -596,4 +596,3 @@ pub fn subcommand_migrate_restore() -> Command { migrate_restore } - diff --git a/src/cli/commands.rs b/src/cli/commands.rs index 5c12e0b6..289943b1 100644 --- a/src/cli/commands.rs +++ b/src/cli/commands.rs @@ -25,4 +25,4 @@ pub mod log; pub mod migrate_backup; pub mod migrate_restore; pub mod update_hsm_group; -pub mod update_node; \ No newline at end of file +pub mod update_node; diff --git a/src/cli/commands/apply_cluster.rs b/src/cli/commands/apply_cluster.rs index 79d923e6..613a0860 100644 --- a/src/cli/commands/apply_cluster.rs +++ b/src/cli/commands/apply_cluster.rs @@ -9,7 +9,8 @@ use mesa::{ capmc, cfs::{ self, - session::{self, http_client::post, CfsSessionRequest}, configuration::r#struct::configuration::CfsConfigurationRequest, + configuration::r#struct::configuration::CfsConfigurationRequest, + session::{self, http_client::post, CfsSessionRequest}, }, hsm, ims::image, diff --git a/src/cli/commands/apply_configuration.rs b/src/cli/commands/apply_configuration.rs index ef98a140..eb0c0a04 100644 --- a/src/cli/commands/apply_configuration.rs +++ b/src/cli/commands/apply_configuration.rs @@ -1,4 +1,4 @@ -use mesa::shasta::cfs::{configuration::r#struct::configuration::CfsConfigurationRequest, self}; +use mesa::shasta::cfs::{self, configuration::r#struct::configuration::CfsConfigurationRequest}; use serde_yaml::Value; use std::path::PathBuf; @@ -41,7 +41,9 @@ pub async fn exec( } if bos_session_template_list_yaml.is_some() { - log::warn!("SAT file has data in session_template section. This information will be ignored.") + log::warn!( + "SAT file has data in session_template section. This information will be ignored." + ) } let empty_vec = &Vec::new(); diff --git a/src/cli/commands/apply_image.rs b/src/cli/commands/apply_image.rs index 9710fc79..e288988d 100644 --- a/src/cli/commands/apply_image.rs +++ b/src/cli/commands/apply_image.rs @@ -6,7 +6,15 @@ use mesa::{ configuration::http_client::http_client::put, session::{get_response_struct::CfsSessionGetResponse, http_client::http_client::post}, }, - shasta::{kubernetes, cfs::{configuration::r#struct::{get_put_payload::CfsConfigurationResponse, configuration::CfsConfigurationRequest}, session::CfsSessionRequest}}, + shasta::{ + cfs::{ + configuration::r#struct::{ + configuration::CfsConfigurationRequest, get_put_payload::CfsConfigurationResponse, + }, + session::CfsSessionRequest, + }, + kubernetes, + }, }; use serde_yaml::Value; diff --git a/src/cli/commands/config_show.rs b/src/cli/commands/config_show.rs index 0c48dd9f..e610d13a 100644 --- a/src/cli/commands/config_show.rs +++ b/src/cli/commands/config_show.rs @@ -43,7 +43,8 @@ pub async fn exec( let settings_hsm_available_vec = realm_access_role_vec; */ let hsm_group_available: Vec = - get_hsm_name_available_from_jwt_or_all(shasta_token, shasta_base_url, shasta_root_cert).await; + get_hsm_name_available_from_jwt_or_all(shasta_token, shasta_base_url, shasta_root_cert) + .await; let site_table: HashMap = settings.get_table("sites").unwrap(); diff --git a/src/cli/commands/delete_data_related_to_cfs_configuration.rs b/src/cli/commands/delete_data_related_to_cfs_configuration.rs index e9bc24aa..3ac923ad 100644 --- a/src/cli/commands/delete_data_related_to_cfs_configuration.rs +++ b/src/cli/commands/delete_data_related_to_cfs_configuration.rs @@ -5,7 +5,11 @@ use chrono::NaiveDateTime; use comfy_table::Table; use dialoguer::{theme::ColorfulTheme, Confirm}; use mesa::{ - shasta, manta::{bos::template::get_image_id_from_bos_sessiontemplate_vec, cfs::session::get_image_id_from_cfs_session_vec}, + manta::{ + bos::template::get_image_id_from_bos_sessiontemplate_vec, + cfs::session::get_image_id_from_cfs_session_vec, + }, + shasta, }; use serde_json::Value; @@ -185,14 +189,11 @@ pub async fn delete_data_related_cfs_configuration( }); // Get image ids from CFS sessions and BOS sessiontemplate related to CFS configuration to delete - let image_id_from_cfs_session_vec = - get_image_id_from_cfs_session_vec(&cfs_session_value_vec); + let image_id_from_cfs_session_vec = get_image_id_from_cfs_session_vec(&cfs_session_value_vec); // Get image ids from BOS session template related to CFS configuration to delete let image_id_from_bos_sessiontemplate_vec = - get_image_id_from_bos_sessiontemplate_vec( - &bos_sessiontemplate_value_vec, - ); + get_image_id_from_bos_sessiontemplate_vec(&bos_sessiontemplate_value_vec); // Combine image ids from CFS session and BOS session template let mut image_id_vec: Vec<&str> = [ diff --git a/src/cli/commands/get_images.rs b/src/cli/commands/get_images.rs index d60d442f..3a3e6b24 100644 --- a/src/cli/commands/get_images.rs +++ b/src/cli/commands/get_images.rs @@ -17,7 +17,8 @@ pub async fn exec( shasta_root_cert, hsm_group_name_vec, limit_number, - ).await; + ) + .await; // Print data let mut table = Table::new(); @@ -33,7 +34,13 @@ pub async fn exec( ]); for image_details in image_detail_vec { - table.add_row(vec![image_details.0.id.as_ref().unwrap(), &image_details.0.name, image_details.0.created.as_ref().unwrap(), &image_details.1, &image_details.2]); + table.add_row(vec![ + image_details.0.id.as_ref().unwrap(), + &image_details.0.name, + image_details.0.created.as_ref().unwrap(), + &image_details.1, + &image_details.2, + ]); } println!("{table}"); diff --git a/src/cli/commands/get_template.rs b/src/cli/commands/get_template.rs index 8cd26e3c..f75e2132 100644 --- a/src/cli/commands/get_template.rs +++ b/src/cli/commands/get_template.rs @@ -9,7 +9,10 @@ pub async fn exec( bos_sessiontemplate_name_opt: Option<&String>, limit_number_opt: Option<&u8>, ) { - log::info!("Get BOS sessiontemplates for HSM groups: {:?}", hsm_group_name_vec); + log::info!( + "Get BOS sessiontemplates for HSM groups: {:?}", + hsm_group_name_vec + ); let mut bos_sessiontemplate_vec = mesa::mesa::bos::sessiontemplate::http_client::get_all( shasta_token, diff --git a/src/cli/commands/migrate_restore.rs b/src/cli/commands/migrate_restore.rs index 05cecaee..d5f5429c 100644 --- a/src/cli/commands/migrate_restore.rs +++ b/src/cli/commands/migrate_restore.rs @@ -34,4 +34,4 @@ pub async fn exec( // } else { // bos::template::utils::print_table(bos_templates); // } -} \ No newline at end of file +} diff --git a/src/common.rs b/src/common.rs index 26fbedc8..4001160c 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,6 +1,6 @@ pub mod bos_sessiontemplate_utils; -pub mod cfs_session_utils; pub mod cfs_configuration_utils; +pub mod cfs_session_utils; pub mod cluster_ops; pub mod config_ops; pub mod gitea; diff --git a/src/common/gitea.rs b/src/common/gitea.rs index 55fbf56a..00f4650b 100644 --- a/src/common/gitea.rs +++ b/src/common/gitea.rs @@ -20,8 +20,8 @@ pub mod http_client { .trim_start_matches(gitea_internal_base_url) .trim_end_matches(".git"); /* let repo_name = repo_name - .trim_start_matches(gitea_external_base_url) - .trim_end_matches(".git"); */ + .trim_start_matches(gitea_external_base_url) + .trim_end_matches(".git"); */ log::info!("repo_url: {}", repo_url); log::info!("gitea_base_url: {}", gitea_internal_base_url); diff --git a/src/common/node_ops.rs b/src/common/node_ops.rs index 9a7bbe2f..060ce39d 100644 --- a/src/common/node_ops.rs +++ b/src/common/node_ops.rs @@ -103,10 +103,15 @@ pub async fn validate_xnames( xnames: &[&str], hsm_group_name_opt: Option<&String>, ) -> bool { - let hsm_group_members: Vec<_> = if let Some(hsm_group_name) = hsm_group_name_opt { - hsm::http_client::get_hsm_group(shasta_token, shasta_base_url, shasta_root_cert, hsm_group_name) - .await - .unwrap()["members"]["ids"] + let hsm_group_members: Vec<_> = if let Some(hsm_group_name) = hsm_group_name_opt { + hsm::http_client::get_hsm_group( + shasta_token, + shasta_base_url, + shasta_root_cert, + hsm_group_name, + ) + .await + .unwrap()["members"]["ids"] .as_array() .unwrap() .to_vec() diff --git a/src/main.rs b/src/main.rs index 05b84c8b..b23b1596 100644 --- a/src/main.rs +++ b/src/main.rs @@ -27,9 +27,9 @@ async fn main() -> core::result::Result<(), Box> { .unwrap(); /* let site_available_vec = site_detail_hashmap - .keys() - .map(|site| site.clone()) - .collect::>(); */ + .keys() + .map(|site| site.clone()) + .collect::>(); */ let shasta_base_url = site_detail_value .get("shasta_base_url")