Skip to content

Commit b09f9a5

Browse files
committed
Ensure save path exists before writing tc data
1 parent 2806b65 commit b09f9a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

node_cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def RunProcess(node_id, device_dict, user_info_object, run_once=False, log_dir=N
469469
PreProcess(log_dir=log_dir)
470470

471471
save_path = Path(ConfigModule.get_config_value("sectionOne", "temp_run_file_path", temp_ini_file)) / "attachments"
472-
FL.CreateFolder(save_path)
472+
save_path.mkdir(exist_ok=True, parents=True)
473473

474474
# --- START websocket service connections --- #
475475

@@ -500,6 +500,8 @@ def response_callback(response: str):
500500
node_json = adapter.adapt(response, node_id)
501501

502502
# 2. Save the json for MainDriver to find
503+
# Ensure that the parent dirs actually exist before writing to the json file.
504+
save_path.mkdir(exist_ok=True, parents=True)
503505
with open(save_path / f"{node_id}.zeuz.json", "w", encoding="utf-8") as f:
504506
f.write(json.dumps(node_json))
505507

0 commit comments

Comments
 (0)