From: Deepika Upadhyay Date: Mon, 29 Mar 2021 14:46:51 +0000 (+0530) Subject: check ctx.archive is present or not in yaml config X-Git-Tag: 1.2.0~264^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7fdb2211afab0382700258baffe8732f573504ab;p=teuthology.git 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 --- diff --git a/teuthology/misc.py b/teuthology/misc.py index 767da3193..d88d19b6c 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():