]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
worker: create archive_dir before putting log file in it
authorKefu Chai <kchai@redhat.com>
Wed, 12 Sep 2018 08:43:54 +0000 (16:43 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 12 Sep 2018 09:01:35 +0000 (17:01 +0800)
before d488b9bd, the memo for rerunning a suite is noted down by the
last-in-suite job. when the last-in-suite job is performed, the
archive_dir has been created by the jobs which performs tests, see
the `Creating archive dir` line in run_job() in teuthology/worker.py .

but after d488b9bd, the memo is logged by the first-in-suite job, by
then, none of the test jobs is performed, so their archive dirs are not
created. i think that's why the first-in-suite job fails to write the
memo to $archive_dir/results.log.

Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/worker.py

index 401f9d39308db7d95b14e17de22d6fc01b5b690e..8e061c66f3d1991f73a7655c9dd51f0523b099fb 100644 (file)
@@ -193,12 +193,12 @@ def run_job(job_config, teuth_bin_path, archive_dir, verbose):
     if job_config.get('first_in_suite') or job_config.get('last_in_suite'):
         if teuth_config.results_server:
             report.try_delete_jobs(job_config['name'], job_config['job_id'])
+        suite_archive_dir = os.path.join(archive_dir, safe_archive)
+        safepath.makedirs('/', suite_archive_dir)
         args = [
             os.path.join(teuth_bin_path, 'teuthology-results'),
-            '--archive-dir',
-            os.path.join(archive_dir, safe_archive),
-            '--name',
-            job_config['name'],
+            '--archive-dir', suite_archive_dir,
+            '--name', job_config['name'],
         ]
         if job_config.get('first_in_suite'):
             log.info('Generating memo for %s', job_config['name'])