diff --git a/provisioner/src/lib.rs b/provisioner/src/lib.rs index 9e215dcf9..a5e639f69 100644 --- a/provisioner/src/lib.rs +++ b/provisioner/src/lib.rs @@ -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> { @@ -969,7 +966,7 @@ mod tests { "fqdn".to_string(), "pg".to_string(), "mongodb".to_string(), - PathBuf::from("."), + TempDir::new().unwrap().into_path(), ) .await .unwrap()