Skip to content

Commit 714bb9a

Browse files
[Fix] Automation-log folder bug
1 parent ad285f9 commit 714bb9a

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

node_cli.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,6 @@ def update_machine_info(node_id, should_print=True):
418418

419419
def RunProcess(node_id, run_once=False, log_dir=None):
420420
try:
421-
PreProcess(log_dir=log_dir)
422-
423-
save_path = Path(ConfigModule.get_config_value("sectionOne", "temp_run_file_path", temp_ini_file))
424-
425421
# --- START websocket service connections --- #
426422

427423
server_url = urlparse(ConfigModule.get_config_value("Authentication", "server_address"))
@@ -446,10 +442,15 @@ def RunProcess(node_id, run_once=False, log_dir=None):
446442
node_json = None
447443
def response_callback(response: str):
448444
nonlocal node_json
449-
nonlocal save_path
450-
save_path.mkdir(exist_ok=True, parents=True)
445+
nonlocal log_dir
446+
if log_dir is None:
447+
log_dir = temp_ini_file.parent
448+
save_path = Path(log_dir)
451449
if not save_path.exists():
452450
print(f"Folder created: {save_path}")
451+
save_path.mkdir(exist_ok=True, parents=True)
452+
PreProcess(log_dir=log_dir)
453+
453454
try:
454455
with open(save_path / "deploy-response.txt", "w", encoding="utf-8") as f:
455456
f.write(response)

0 commit comments

Comments
 (0)