summaryrefslogtreecommitdiffstats
path: root/crates/core/tedge_agent/src/agent.rs
diff options
context:
space:
mode:
authorinitard <solo@softwareag.com>2022-02-17 16:31:28 +0000
committerinitard <solo@softwareag.com>2022-02-22 23:24:59 +0000
commitb2315cfd0665ab6935a17bae7bd566265ca4c2c6 (patch)
tree1ec939ed3b8ed1c1ba0ee26763594370ce84bd65 /crates/core/tedge_agent/src/agent.rs
parentb73cac276ed0397db43ffe7d97b5202660394b41 (diff)
--config-dir for tedge command (#814)
When the tedge command is called, you can now pass `--config-dir` as a cli option. The default value for this option is "/etc/tedge" and is defined in tedge_config/src/tedge_config_location.rs. - removed if/else tedge_config::TEdgeConfigLocation::from_users_home_location logic from tedge main.rs - added --config-dir option to tedge command - fixed failing tests Signed-off-by: initard <solo@softwareag.com>
Diffstat (limited to 'crates/core/tedge_agent/src/agent.rs')
-rw-r--r--crates/core/tedge_agent/src/agent.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/core/tedge_agent/src/agent.rs b/crates/core/tedge_agent/src/agent.rs
index 18562696..d1285c22 100644
--- a/crates/core/tedge_agent/src/agent.rs
+++ b/crates/core/tedge_agent/src/agent.rs
@@ -78,7 +78,7 @@ impl Default for SmAgentConfig {
let log_dir = PathBuf::from("/var/log/tedge/agent");
- let config_location = TEdgeConfigLocation::from_default_system_location();
+ let config_location = TEdgeConfigLocation::default();
let download_dir = PathBuf::from("/tmp");
@@ -567,8 +567,7 @@ mod tests {
#[tokio::test]
async fn check_agent_restart_file_is_created() -> Result<(), AgentError> {
assert_eq!(INIT_COMMAND, "echo");
- let tedge_config_location =
- tedge_config::TEdgeConfigLocation::from_default_system_location();
+ let tedge_config_location = tedge_config::TEdgeConfigLocation::default();
let agent = SmAgent::try_new(
"tedge_agent_test",
SmAgentConfig::try_new(tedge_config_location).unwrap(),