Skip to content

Commit

Permalink
provisioner: improve access key file path creation
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianbarbu committed Jun 29, 2023
1 parent 321fc4d commit 1392880
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions provisioner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -838,15 +838,12 @@ impl DynamoDBHandler {
}

fn get_access_key_file_name(&self) -> String {
format!(
"{}{}.txt",
self.provisioner_state
.as_path()
.as_os_str()
.to_str()
.expect("to have a valid utf8 filename"),
self.prefix
)
let mut access_key_file_path = self.provisioner_state.clone();
access_key_file_path.push(self.prefix.clone());
access_key_file_path
.to_str()
.expect("to have a valid access key file name")
.to_string()
}

async fn delete_saved_access_key(&self) -> Result<(), std::io::Error> {
Expand Down Expand Up @@ -969,7 +966,7 @@ mod tests {
"fqdn".to_string(),
"pg".to_string(),
"mongodb".to_string(),
PathBuf::from("."),
TempDir::new().unwrap().into_path(),
)
.await
.unwrap()
Expand Down

0 comments on commit 1392880

Please sign in to comment.