]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
check ctx.archive is present or not in yaml config 1636/head
authorDeepika Upadhyay <dupadhya@redhat.com>
Mon, 29 Mar 2021 14:46:51 +0000 (20:16 +0530)
committerDeepika Upadhyay <dupadhya@redhat.com>
Mon, 29 Mar 2021 14:46:51 +0000 (20:16 +0530)
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 <dupadhya@redhat.com>
teuthology/misc.py

index 767da3193a474bfdc312bec14af4adabdec695e5..d88d19b6c7924595d1756f0729621cd200a765ad 100644 (file)
@@ -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():