Skip to content

Commit 0073bf7

Browse files
committed
refactor: clean code
1 parent 0a3d94b commit 0073bf7

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

src/backend_connector/bos.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ impl ClusterTemplateTrait for Csm {
124124
hsm_group_name_vec,
125125
hsm_member_vec,
126126
limit_number_opt,
127-
);
127+
)
128+
.map_err(|e| Error::Message(e.to_string()))?;
128129

129130
Ok(
130131
bos_sessiontemplate_vec

src/backend_connector/cfs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ impl CfsTrait for Csm {
248248
log::info!(
249249
"Find image ID related to CFS configuration {} in CFS session {}",
250250
cfs_session.configuration_name().unwrap(),
251-
cfs_session.name.as_ref().unwrap()
251+
cfs_session.name
252252
);
253253

254254
let new_image_id_opt = if cfs_session

src/cfs/session/http_client/v2/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl CfsSessionGetResponse {
3838
impl From<FrontEndCfsSessionGetResponse> for CfsSessionGetResponse {
3939
fn from(value: FrontEndCfsSessionGetResponse) -> Self {
4040
CfsSessionGetResponse {
41-
name: value.name,
41+
name: value.name.unwrap(),
4242
configuration: value.configuration.map(Configuration::from),
4343
ansible: value.ansible.map(Ansible::from),
4444
target: value.target.map(Target::from),
@@ -51,7 +51,7 @@ impl From<FrontEndCfsSessionGetResponse> for CfsSessionGetResponse {
5151
impl Into<FrontEndCfsSessionGetResponse> for CfsSessionGetResponse {
5252
fn into(self) -> FrontEndCfsSessionGetResponse {
5353
FrontEndCfsSessionGetResponse {
54-
name: self.name,
54+
name: Some(self.name),
5555
configuration: self
5656
.configuration
5757
.map(|configuration| configuration.into()),

src/cfs/session/http_client/v3/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ pub struct CfsSessionGetResponse {
298298
impl From<FrontEndCfsSessionGetResponse> for CfsSessionGetResponse {
299299
fn from(value: FrontEndCfsSessionGetResponse) -> Self {
300300
CfsSessionGetResponse {
301-
name: value.name,
301+
name: value.name.unwrap(),
302302
configuration: value.configuration.map(Configuration::from),
303303
ansible: value.ansible.map(Ansible::from),
304304
target: value.target.map(Target::from),
@@ -313,7 +313,7 @@ impl From<FrontEndCfsSessionGetResponse> for CfsSessionGetResponse {
313313
impl Into<FrontEndCfsSessionGetResponse> for CfsSessionGetResponse {
314314
fn into(self) -> FrontEndCfsSessionGetResponse {
315315
FrontEndCfsSessionGetResponse {
316-
name: self.name,
316+
name: Some(self.name),
317317
configuration: self
318318
.configuration
319319
.map(|configuration| configuration.into()),

src/cfs/session/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn filter(
8888
"HSM groups to filter from: {:?}",
8989
hsm_group_name_available_vec
9090
);
91-
log::info!("Xnames to filter from: {:?}", xname_available_vec);
91+
log::debug!("Xnames to filter from: {:?}", xname_available_vec);
9292

9393
if let Some(configuration_name_pattern) = configuration_name_pattern_opt {
9494
let glob = Glob::new(configuration_name_pattern)?.compile_matcher();

0 commit comments

Comments
 (0)