diff options
author | initard <alex.solomes@softwareag.com> | 2022-09-01 19:15:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-01 19:15:13 +0100 |
commit | f791e1636ccf0579f862d67ef6a49852011aa59c (patch) | |
tree | d1077033aa57a2f8e28e8afa4f08bd789c4d6677 | |
parent | b7616697448bb2cc31df197dd0d9126de583dd97 (diff) | |
parent | 9ec91ebbae04d492a9ab8da29582dcbc59205660 (diff) |
Merge pull request #1398 from initard/bugfix/1387/tedge-agent-duplicated-sub-folders
fixed tedge agent --init duplicating sub folders
-rw-r--r-- | crates/core/tedge_agent/src/agent.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/crates/core/tedge_agent/src/agent.rs b/crates/core/tedge_agent/src/agent.rs index bf8f2821..db18f4ea 100644 --- a/crates/core/tedge_agent/src/agent.rs +++ b/crates/core/tedge_agent/src/agent.rs @@ -229,15 +229,8 @@ impl SmAgent { pub async fn init(&mut self, config_dir: PathBuf) -> Result<(), anyhow::Error> { // `config_dir` by default is `/etc/tedge` (or whatever the user sets with --config-dir) let config_dir = config_dir.display(); - let log_path = self.config.log_dir.display(); create_directory_with_user_group(&format!("{config_dir}/.agent"), "tedge", "tedge", 0o775)?; - create_directory_with_user_group(&format!("{log_path}/tedge"), "tedge", "tedge", 0o775)?; - create_directory_with_user_group( - &format!("{log_path}/tedge/agent"), - "tedge", - "tedge", - 0o775, - )?; + create_directory_with_user_group(self.config.log_dir.clone(), "tedge", "tedge", 0o775)?; info!("Initializing the tedge agent session"); mqtt_channel::init_session(&self.config.mqtt_config).await?; |