From 7fdb2211afab0382700258baffe8732f573504ab Mon Sep 17 00:00:00 2001 From: Deepika Upadhyay Date: Mon, 29 Mar 2021 20:16:51 +0530 Subject: [PATCH] check ctx.archive is present or not in yaml config this specifically is for interactive on error mode where we usually do not specify archive_path which fails without this check Signed-off-by: Deepika Upadhyay --- teuthology/misc.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teuthology/misc.py b/teuthology/misc.py index 767da3193a..d88d19b6c7 100644 --- a/teuthology/misc.py +++ b/teuthology/misc.py @@ -1336,6 +1336,8 @@ def add_remote_path(ctx, local_dir, remote_dir): Add key/value pair (local_dir: remote_dir) to job's info.yaml. These key/value pairs are read to archive them in case of job timeout. """ + if ctx.archive is None: + return with open(os.path.join(ctx.archive, 'info.yaml'), 'r+') as info_file: info_yaml = yaml.safe_load(info_file) info_file.seek(0) @@ -1351,6 +1353,8 @@ def archive_logs(ctx, remote_path, log_path): Archive directories from all nodes in a cliuster. It pulls all files in remote_path dir to job's archive dir under log_path dir. """ + if ctx.archive is None: + return path = os.path.join(ctx.archive, 'remote') os.makedirs(path, exist_ok=True) for remote in ctx.cluster.remotes.keys(): -- 2.39.5